[填空题] 下面程序是由鼠标事件在窗体上画图,如果按下鼠标将可以画图,双击窗体可以清除所画图形。补充完整下面的程序。 首先在窗体层定义如下变量: Dim PaintStart As Boolean
[填空题] 下面程序是由鼠标事件在窗体上画图,如果按下鼠标将可以画图,双击窗体可以清除所画图形。补充完整下面的程序。
首先在窗体层定义如下变量:
Dim PaintStart As Boolean
编写如下事件过程:
Private Sub Form_Load ( )
DrawWidth = 2
ForeColor = vbGreen
End Sub
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, _
X As Single, Y As Single)
PaintStart = True
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, _
X As Single, Y As Single)
If PaintStart Then
PSet (X, Y)
End If
End Sub
Private Sub Form_MouseUp (Button As Integer, Shift As Integer, _
X As Single, Y As Single)
______
End Sub
Private Sub Form_DblClick( )
Cls
End Sub
参考答案: