button click event - simple question

  • Thread starter Thread starter Bernie Yaeger
  • Start date Start date
B

Bernie Yaeger

If the user clicks the processit button, the click event code runs. What
happens if he/she clicks it again before it's done processing? Does the
system remember and process twice? Does it ignore a button click if the
waitcursor is active but not if the default cursor is active?

OK - I apologize - 2 questions.

Tx,

Bernie
 
Bernie Yaeger said:
If the user clicks the processit button, the click event code runs.
What happens if he/she clicks it again before it's done processing?
Does the system remember and process twice?

Yes, the click event is stored in the message queue and processed as soon as
the previous event(s) has been processed.

More info:
http://msdn.microsoft.com/library/e...erface/windowing/messagesandmessagequeues.asp
Does it ignore a button
click if the waitcursor is active but not if the default cursor is
active?

The behavior does not depend on the cursor, but you should set the cursor
depending on the application/window state.
 
* "Bernie Yaeger said:
If the user clicks the processit button, the click event code runs. What
happens if he/she clicks it again before it's done processing? Does the
system remember and process twice?

The button click will be queued.
Does it ignore a button click if the
waitcursor is active but not if the default cursor is active?

How do you activate this cursor?
 
Hi Herfried,

Is there a generic way to set up a waitcursor such that it will block
repress?

Tx for your help, as always,

Bernie
 
happens if he/she clicks it again before it's done processing? Does the

If you wish to prevent this, disable the button in the click event and then
re-enable it when the click event is finished.

Or, set a boolean to indicate that the code is already in the processing of
the method:

If bAlreadyProcessing then
Exit Sub
Else
bAlreadyProcessing = True
Endif

'.... Processing code here

bAlreadyProcessing = False


Just some ideas
 
Bernie Yaeger said:
Is there a generic way to set up a waitcursor such that it will
block repress?

As I've already written, the look of the cursor does not change the behavior
of the application.
 
Chris Dunaway said:
If you wish to prevent this, disable the button in the click event
and then re-enable it when the click event is finished.

This does not work because the button will be enabled again when the click
is received.
Or, set a boolean to indicate that the code is already in the
processing of the method:

If bAlreadyProcessing then
Exit Sub
Else
bAlreadyProcessing = True
Endif

'.... Processing code here

bAlreadyProcessing = False

Same as above. It only makes sense when you use Application.Doevents during
the process.
 
* "Bernie Yaeger said:
Is there a generic way to set up a waitcursor such that it will block
repress?

Why not disable the controls? This will give the user visual feedback
too.
 
Back
Top