VB picturebox中用橡皮筋技术画线
基本程序写出,就是在画线的时候不知道出现鼠标移动出现很多线,不会删掉我是在picturebox里画的,用form1.cls是不行的...
基本程序写出,就是在画线的时候不知道出现鼠标移动出现很多线,不会删掉
我是在picturebox里画的,用form1.cls是不行的 展开
我是在picturebox里画的,用form1.cls是不行的 展开
2个回答
展开全部
你用的什么技术画的?
用Line方法也很方便
Dim mx As Single, my As Single, flag As Integer
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
mx = X
my = Y
flag = 1
Form1.MousePointer = 2
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If flag = 1 Then
Form1.Cls
Line (mx, my)-(X, Y)
End If
End Sub
Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
flag = 0
Form1.MousePointer = 0
End Sub
pic控件 也有cls方法
用Line方法也很方便
Dim mx As Single, my As Single, flag As Integer
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
mx = X
my = Y
flag = 1
Form1.MousePointer = 2
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If flag = 1 Then
Form1.Cls
Line (mx, my)-(X, Y)
End If
End Sub
Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
flag = 0
Form1.MousePointer = 0
End Sub
pic控件 也有cls方法
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询