vb中怎么设置开关,鼠标按下开关打开,鼠标送来开关关闭
展开全部
MouseDown、MouseUp事件
把开关开启关闭写在这两事件中
举例:在窗体form上点击鼠标事件
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 Then Print Now 'button=1鼠标左键按下,=2为鼠标右键按下
End Sub
Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
Print "sk"
End Sub
你把你的的开关命令替换print事件
把开关开启关闭写在这两事件中
举例:在窗体form上点击鼠标事件
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 Then Print Now 'button=1鼠标左键按下,=2为鼠标右键按下
End Sub
Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
Print "sk"
End Sub
你把你的的开关命令替换print事件
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询