Mouse Buffer Clear 
Author Message
 Mouse Buffer Clear

Hi,

Want to clear the mouse buffer, during an event.   Thus the user cannot keep
clicking a button (even if its disabled).

Please has anyone got any quick methods?

Thanks
Dave



Sun, 29 May 2005 04:43:20 GMT  
 Mouse Buffer Clear
You need to set the button's Enabled property to False at the start of its Click event code and then set it back to True at the end. However, before you set it back to True you need to use a DoEvents command, which will process all outstanding Click events on that button while it is still disabled, and *before* it becomes enabled again. Processing Click events while the button is disabled will *not* cause the click event code to be executed (and it will effectively "get rid of" any extra clicks). Have a look at the following code. The procedure will be executed just once, regardless of how many extra clicks the user makes during the period that the Click event code is running:

Private Sub Command1_Click()
Command1.Enabled = False
Print "Button clicked"
Dim t1 As Single, t2 As Single
t1 = Timer
Do
Loop Until (Timer - t1) > 3
Print "Code Finished."
DoEvents ' this processes all outstanding click events
Command1.Enabled = True
End Sub

Mike


Quote:
> Hi,

> Want to clear the mouse buffer, during an event.   Thus the user cannot keep
> clicking a button (even if its disabled).

> Please has anyone got any quick methods?

> Thanks
> Dave



Sun, 29 May 2005 05:15:40 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Mouse/keyboard buffer clear ...possible ?

2. Clearing the Mouse buffer

3. How can I Clear the Undo Buffer?

4. HOW do I clear the Keyboard Buffer???

5. Clearing the keyboard buffer

6. Clearing Print Buffer

7. clearing the keyboard buffer

8. Winsock - Clearing the buffer when .State=sckClosing

9. How do you clear the keyboard buffer?

10. MCI wav Record How to clear buffer

11. Need to Clear Buffer?

12. Winsock - Clearing the buffer when .State=sckClosing

 

 
Powered by phpBB® Forum Software