vb中当按下鼠标时怎么写?
当按下鼠标左键时,执行某某动作当按下键盘某个键时,执行某某动作。用if该怎么写??楼下答案写的很多。PrivateSubForm_MouseDown(ButtonAsIn...
当按下鼠标左键时,执行某某动作
当按下键盘某个键时,执行某某动作。
用if 该怎么写??
楼下答案写的很多。
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 Then
qt = false
end if
这个怎么执行不了??
我只是想知道
if 按下鼠标左键时 then
qt =false
end if 展开
当按下键盘某个键时,执行某某动作。
用if 该怎么写??
楼下答案写的很多。
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 Then
qt = false
end if
这个怎么执行不了??
我只是想知道
if 按下鼠标左键时 then
qt =false
end if 展开
2个回答
展开全部
Private Sub Form_KeyPress(KeyAscii As Integer)
MsgBox "你按了键盘的" & Chr(KeyAscii) & "键"
End Sub
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 Then
MsgBox "你按了鼠标左键!"
ElseIf Button = 2 Then
MsgBox "你按了鼠标右键!"
End If
End Sub
Private Sub Form_Load()
Form1.KeyPreview = True
Form1.AutoRedraw = True
Print "请点击鼠标或按任意键"
End Sub
MsgBox "你按了键盘的" & Chr(KeyAscii) & "键"
End Sub
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 Then
MsgBox "你按了鼠标左键!"
ElseIf Button = 2 Then
MsgBox "你按了鼠标右键!"
End If
End Sub
Private Sub Form_Load()
Form1.KeyPreview = True
Form1.AutoRedraw = True
Print "请点击鼠标或按任意键"
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询