
提供一个绘制任意曲线的简单代码。其他功能类似,希望能举一反三。
在窗兄陵体中添加一个Picture box,然后输入命令如下:
Dim oldx As SingleDim oldy As Single
Private Sub Picture1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 Then 饥尘慎 '当鼠标左建按下时发生
Picture1.Line (oldx, oldy)-(X, Y)
oldx = X
oldy = Y
End If
End Sub
Private Sub Picture1_Mousedown(Button As Integer, Shift As Integer, X As Single, Y As 烂敬Single)
oldx = X
oldy = Y
End Sub
Picture1控件是不能透明野橘告的伍差 但是颂明Picture控件支持画Dim X1 As Single
Dim Y1 As Single
Private Sub Picture1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = vbLeftButton Then
X1 = X
Y1 = Y
End If
End Sub
Private Sub Picture1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = vbLeftButton Then
Picture1.Line (X1, Y1)-(X, Y)
X1 = X
Y1 = Y
End If
End Sub
无悬赏,无锋巧详解:历基郑Private Sub Command1_Click()
Shell "C:\肢颂WINDOWS\system32\mspaint.exe", vbMaximizedFocus
End Sub
觉得OK:::
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)