vb中用鼠标事件完成:按下鼠标左键开始画图;若同时按下Shift键开始擦图
展开全部
Dim i As Boolean
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
i = True
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Shift = 1 Then Me.ForeColor = Me.BackColor Else Me.ForeColor = vbBlack
If Not i Then
Me.CurrentX = X
Me.CurrentY = Y
Else
Me.Line -(X, Y)
End If
End Sub
Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
i = False
End Sub
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
i = True
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Shift = 1 Then Me.ForeColor = Me.BackColor Else Me.ForeColor = vbBlack
If Not i Then
Me.CurrentX = X
Me.CurrentY = Y
Else
Me.Line -(X, Y)
End If
End Sub
Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
i = False
End Sub
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询