VB6.0中command1随光标的移动而移动的代码怎么写啊
1个回答
展开全部
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Command1.Left = X
Command1.Top = Y
End Sub
这样一来鼠标指针将定位在command1的左上角;
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Command1.Left = X - Command1.Width / 2
Command1.Top = Y - Command1.Height / 2
End Sub
如果采用这段代码的话,鼠标指针将定位在command1中间。
Command1.Left = X
Command1.Top = Y
End Sub
这样一来鼠标指针将定位在command1的左上角;
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Command1.Left = X - Command1.Width / 2
Command1.Top = Y - Command1.Height / 2
End Sub
如果采用这段代码的话,鼠标指针将定位在command1中间。
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询