加一個TIMER1
代碼如下
Dim bleft As Integer
Dim bright As Integer
Dim alldown As BooleanPrivate Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 Then bleft = Button
If Button = 2 Then bright = Button
If bleft <> 0 And bright <> 0 Then alldown = True
Timer1.Tag = ""
Timer1.Interval = 50
Timer1.Enabled = False
End SubPrivate Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Timer1.Enabled = False Then Timer1.Enabled = True
If Button = bleft Then bleft = 0
If Button = bright Then bright = 0
If alldown = True And bleft = 0 And bright = 0 And Timer1.Tag = "" Then
MsgBox "left and right button!!"
alldown = False
Timer1.Enabled = False
End If
End Sub
Private Sub Timer1_Timer()
Timer1.Tag = "t"
End Sub
代碼如下
Dim bleft As Integer
Dim bright As Integer
Dim alldown As BooleanPrivate Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 Then bleft = Button
If Button = 2 Then bright = Button
If bleft <> 0 And bright <> 0 Then alldown = True
Timer1.Tag = ""
Timer1.Interval = 50
Timer1.Enabled = False
End SubPrivate Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Timer1.Enabled = False Then Timer1.Enabled = True
If Button = bleft Then bleft = 0
If Button = bright Then bright = 0
If alldown = True And bleft = 0 And bright = 0 And Timer1.Tag = "" Then
MsgBox "left and right button!!"
alldown = False
Timer1.Enabled = False
End If
End Sub
Private Sub Timer1_Timer()
Timer1.Tag = "t"
End Sub
能不能弄个缓冲,在一定时间差内就算同时up啊,和你一起关注这个问题,看看有什么好的办法没有
谢谢你啊,hnlzh(吸海垂虹) 的那个土的快掉渣的方法,还真行的通,我先凑和用,实现功能,省着老板炒我啊,希望你能想出更好的方法
可是我想问一个问题,在同时按下左右两键的时候,你那个mouse_down事件是响应一次还是两次啊
看结果应当知道是一次,可是既然响应一次,就是说系统能一次识别两键同时按下的情况
那我按msdn里说的,把button=3作为左右同时按下,为什么不好使呢,望指教,谢谢!!!
相應兩次﹐一次搞不定的
土怎么啦﹐土八路就打下了江山﹒﹒
dzbswl(白雪儿)說她忙著洗衣服﹐沒時間回信﹐請妳原諒﹒﹒
谢谢你,你发的源码我收到了,在那个贴子里,我说了“谢谢”呵呵,而且运行了,真的很棒
hnlzh(吸海垂虹)
不就说有点土吗?你可真不象你的太码那么大大方,不过要谢谢你啊
我是说你的代码写的很大方,可人很小气,别生气,我是实事求事
有机會向妳請教winsock問題﹒﹒
有机會向妳請教winsock問題﹒﹒ 希望你多指教
把妳的qq放出來啊﹗﹗
其实winsock我也是刚会的,也只会一些非常浅显的东西.
半个月之前还什么也不会呢,前些日子都快要被它折磨死了,好在活过来了
我没有QQ,即使有也怕你黑我啊
没问题,hnlzh(吸海垂虹)能把大海吸尽,希望你能把他身上骨髓吸干
谢谢你,你别生气,以后有问题还要问你啊