如何用VB编写一段程序,实现按下鼠标移动时,可以再图片框中进行绘图,放开鼠标则绘图结束拜托各位大神
1个回答
展开全部
Dim draw As Boolean Dim x1 As Single, y1 As Single Private Sub Picture1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) draw = True x1 = X y1 = Y End Sub Private Sub Picture1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) If draw = True Then Picture1.Line (x1, y1)-(X, Y), vbRed x1 = X y1 = Y End If End Sub Private Sub Picture1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single) draw = False End Sub
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询