VB编程,在图片框控件P1绘制红色边线绿色填充的矩形,鼠标按下处为矩形左上角、抬起处为右下角。正确
VB编程,在图片框控件P1绘制红色边线绿色填充的矩形,鼠标按下处为矩形左上角、抬起处为右下角。正确者立刻采纳...
VB编程,在图片框控件P1绘制红色边线绿色填充的矩形,鼠标按下处为矩形左上角、抬起处为右下角。正确者立刻采纳
展开
展开全部
Option Explicit
Private x0 As Single
Private y0 As Single
Private Sub Picture1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
x0 = X
y0 = Y
End Sub
Private Sub Picture1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
Picture1.Line (x0, y0)-(X, Y), QBColor(2), BF
Picture1.Line (x0, y0)-(X, Y), QBColor(12), B
End Sub
Private x0 As Single
Private y0 As Single
Private Sub Picture1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
x0 = X
y0 = Y
End Sub
Private Sub Picture1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
Picture1.Line (x0, y0)-(X, Y), QBColor(2), BF
Picture1.Line (x0, y0)-(X, Y), QBColor(12), B
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询