vb中line函数的使用方法
答案:2 悬赏:0 手机版
解决时间 2021-01-22 23:32
- 提问者网友:我一贱你就笑
- 2021-01-22 16:35
vb中line函数的使用方法
最佳答案
- 五星知识达人网友:思契十里
- 2021-01-22 17:51
Line (100, 100)-(3000, 3000)
从100,100画到3000,3000
会不会你坐标点太小了
从100,100画到3000,3000
会不会你坐标点太小了
全部回答
- 1楼网友:行路难
- 2021-01-22 18:37
把画板的scaleMode设置为3,在画板的mousedown事件时记下x,y(用全局变量)在mouseup事件使用line函数画线,从全局变量中的xy到函数的xy
Option Explicit
Private Type point
X As Long
Y As Long
End Type
Dim oldP As point
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 Then oldP.X = X: oldP.Y = Y
End Sub
Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 Then Line (oldP.X, oldP.Y)-(X, Y), RGB(255, 0, 0)
End Sub
Option Explicit
Private Type point
X As Long
Y As Long
End Type
Dim oldP As point
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 Then oldP.X = X: oldP.Y = Y
End Sub
Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 Then Line (oldP.X, oldP.Y)-(X, Y), RGB(255, 0, 0)
End Sub
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯