Is there a way to prevent mouse clicks?

  • Thread starter Thread starter BobV
  • Start date Start date
B

BobV

Group:

Is there a way to prevent mouse clicks while a particular form is active and
a specific subroutine is executing? After the subroutine completes, I'd like
to allow mouse clicks again. What is the statement to do this if it is
possible?

Thanks for your help,
BobV
 
Disable the controls that would respond to a click event. In the example
below, "Command3" is a command button with no code in its Click event
procedure and its Transparent property set to "Yes". Its sole purpose is to
give us somewhere to 'park' the focus, as a control can not be disabled
while it has the focus ...

Private Sub Command0_Click()

Dim lngLoop As Long

Me.Command3.SetFocus

Me.Command0.Enabled = False
Me.Command1.Enabled = False
Me.Command2.Enabled = False
'do something useful here - loop for testing purposes only
For lngLoop = 0 To 1000
DoEvents
Next lngLoop
Me.Command0.Enabled = True
Me.Command1.Enabled = True
Me.Command2.Enabled = True
Me.Command0.SetFocus

End Sub
 
Brendan:

I appreciate you taking the time to respond to my question. This is just
what I was looking for.

BobV
 
Back
Top