4个回答
展开全部
我估计您是这个意思,
双击要调用mousemove的控件,进入之后默认右上角为click,下拉菜单里找到mousemove使用就行,
具体形式见2楼和1楼组合,如下(参照)
(
我举个例子:按键钮原本的颜色是黑色,当滑鼠碰到时就变成红色了,移开之后又变黑。
Private Sub label1_MouseMove(Button As Integer, Shift As Integer, X As Single, y As Single)
Label1.ForeColor = vbRed
End Sub
——————————————————————————————————
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Label1.ForeColor = vbblack
End Sub
)
双击要调用mousemove的控件,进入之后默认右上角为click,下拉菜单里找到mousemove使用就行,
具体形式见2楼和1楼组合,如下(参照)
(
我举个例子:按键钮原本的颜色是黑色,当滑鼠碰到时就变成红色了,移开之后又变黑。
Private Sub label1_MouseMove(Button As Integer, Shift As Integer, X As Single, y As Single)
Label1.ForeColor = vbRed
End Sub
——————————————————————————————————
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Label1.ForeColor = vbblack
End Sub
)
展开全部
鼠标移动时会自动调用Mousemove事件的
事件声明:
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
End Sub
事件声明:
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
End Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
当鼠标在控件上移动时,触发的动作:
句式:
Private Sub FORM_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)'form可换成其他控件名,Button是按键的值,左键=1,右键=2,x是mousemove时鼠标光标的横坐标,y是纵坐标,Shift 用于判断键盘上Shift键、Ctrl键、Alt 键是否被按下,shift=1,ctrl=2,art=4
End Sub
实例:让鼠标在窗体上移动并用鼠标左键点击时显示当前光标位置。
代码:
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 Then,如果按下左键
Cls'清屏
Print X & ";" & Y'输出位置
End If
End Sub
句式:
Private Sub FORM_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)'form可换成其他控件名,Button是按键的值,左键=1,右键=2,x是mousemove时鼠标光标的横坐标,y是纵坐标,Shift 用于判断键盘上Shift键、Ctrl键、Alt 键是否被按下,shift=1,ctrl=2,art=4
End Sub
实例:让鼠标在窗体上移动并用鼠标左键点击时显示当前光标位置。
代码:
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 Then,如果按下左键
Cls'清屏
Print X & ";" & Y'输出位置
End If
End Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
我举个例子:按键钮原本的颜色是黑色,当滑鼠碰到时就变成红色了。
Private Sub label1_MouseMove(Button As Integer, Shift As Integer, X As Single, y As Single)
Label1.ForeColor = vbRed
End Sub
Private Sub label1_MouseMove(Button As Integer, Shift As Integer, X As Single, y As Single)
Label1.ForeColor = vbRed
End Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询