Private Sub Form_DblClick()
Cls
End SubPrivate Sub Form_Load()
DrawWidth = 2
ForeColor = RGB(0, 225, 0)
End SubPrivate Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 2 Then
Print "an xia you jian"
paintnow = TrueEnd IfEnd SubPrivate Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If paintnow = True ThenIf Button = 2 Then
r = Rnd * 1000
Circle (X, Y), r
Else
PSet (X, Y)
End If
End If
Print paintnow
End SubPrivate Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
paintnow = False
End Sub
Cls
End SubPrivate Sub Form_Load()
DrawWidth = 2
ForeColor = RGB(0, 225, 0)
End SubPrivate Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 2 Then
Print "an xia you jian"
paintnow = TrueEnd IfEnd SubPrivate Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If paintnow = True ThenIf Button = 2 Then
r = Rnd * 1000
Circle (X, Y), r
Else
PSet (X, Y)
End If
End If
Print paintnow
End SubPrivate Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
paintnow = False
End Sub
你的两个paintnow变量都只在自己的事件里存在。