BasSchouten
IS-IT--Management
I've got a toolbar with buttons on it. Of course there is some code in the toolbar Buttonclick event to get some things done:
The problems arise when a user accidently clicks twice on the button ... the eventhandler is called a second time while the first hasnt finished yet. This of course yields all kinds of unwanted effects. I'v tried setting the mousepointer to vbHourglass but this doesnt help: my immediate window still shows the following:
Can anybody tell me how I can prevent the second buttonclick?
thanks
Bas Schouten
System Development & Webdesign
CBIS BV Holland
Code:
Private Sub tlbMuteren_ButtonClick(ByVal Button As MSComCtlLib.Button)
MousePointer = vbHourglass
Debug.Print "----Button click toolbar----"
On Error GoTo tlbMuterenClick_Error
Select Case Button.Key
Case "Terug"
RaiseEvent ExitbuttonClick
Case "Nieuw"
AddRecord
Case "Wijzigen"
EditRecord
Case "Verwijderen"
DelRecord
Case "Vernieuwen"
RefreshGrid
End Select
Debug.Print "---Einde button click----"
MousePointer = vbDefault
Exit Sub
tlbMuterenClick_Error:
MousePointer = vbDefault
ErrorHandler Err, "tlbMuteren_Buttonclick"
End Sub
The problems arise when a user accidently clicks twice on the button ... the eventhandler is called a second time while the first hasnt finished yet. This of course yields all kinds of unwanted effects. I'v tried setting the mousepointer to vbHourglass but this doesnt help: my immediate window still shows the following:
Code:
----Button click toolbar----
----Button click toolbar----
Can anybody tell me how I can prevent the second buttonclick?
thanks
Bas Schouten
System Development & Webdesign
CBIS BV Holland
