473,385 Members | 2,028 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

button click event - simple question

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
Nov 20 '05 #1
11 1293
"Bernie Yaeger" <be*****@cherwellinc.com> schrieb
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/en...sagequeues.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.
--
Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #2
* "Bernie Yaeger" <be*****@cherwellinc.com> scripsit:
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?

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #3
Hi Herfried,

me.cursor = cursors.waitcursor

Is there a better way?

Bernie

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:bq*************@ID-208219.news.uni-berlin.de...
* "Bernie Yaeger" <be*****@cherwellinc.com> scripsit:
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?

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>

Nov 20 '05 #4
* "Bernie Yaeger" <be*****@cherwellinc.com> scripsit:
me.cursor = cursors.waitcursor

Is there a better way?


This AFAIR won't block any events.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #5
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
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:bq*************@ID-208219.news.uni-berlin.de...
* "Bernie Yaeger" <be*****@cherwellinc.com> scripsit:
me.cursor = cursors.waitcursor

Is there a better way?


This AFAIR won't block any events.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>

Nov 20 '05 #6
On Tue, 2 Dec 2003 15:26:47 -0500, Bernie Yaeger wrote:
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
--
Chris

To send me an E-mail, remove the underscores and lunchmeat from my E-Mail
address.
Nov 20 '05 #7
"Chris Dunaway" <dunawayc@_lunchmeat_sbcglobal.net> schrieb
On Tue, 2 Dec 2003 15:26:47 -0500, Bernie Yaeger wrote:
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.


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.
--
Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #8
"Bernie Yaeger" <be*****@cherwellinc.com> schrieb

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.
--
Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #9
* "Bernie Yaeger" <be*****@cherwellinc.com> scripsit:
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.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #10
Cor
Did you see my post in the controls group about this?

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

Nov 20 '05 #11
That's what I'm doing. Just thought there might be a better way.

Bernie
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:bq*************@ID-208219.news.uni-berlin.de...
* "Bernie Yaeger" <be*****@cherwellinc.com> scripsit:
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.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>

Nov 20 '05 #12

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: JMCN | last post by:
hello this is absolutely ridiculous :) i have a simple form where if you click the "main menu" command button it should ideally go to the main menu . however, each time i click the menu command...
3
by: Scott Schade | last post by:
I have a form onto which I add a control during execution. The control is a control that I wrote. The control has a number of controls on it. I would like to click on a button on the control and...
6
by: Celine | last post by:
This question might be very trivial but how can I check that a button is clicked. Is there a way to do something like: if(button is clicked) { .... } Thanks Celine
4
by: Rodrigo Ferreira | last post by:
Anyone uses the simple button component from DevExpress?
11
by: CW | last post by:
I have message entry screen that's causing me a bit of an issue. At the moment, there are 2 buttons, one is used to send message to another user (btnSend) and another is used to send messages to...
3
by: Wang | last post by:
Here is the code for a webcontrol, quite simple: ------------------------------------------------------------------------------------------------------------- <%@ Control Language="c#"...
7
by: code100579 | last post by:
Hi there, sorry if this is a really simple question. I need to write code for: If a button is pushed and then one variety of other buttons is pushed then certain options on the program will...
9
by: Neo Geshel | last post by:
I have strip-mined, strip-searched, and completely exhausted the Internet (up to the 30th page on Google, with 100 results per page!!), all without finding an answer to my question AS TO WHY IT...
15
by: Oleg Subachev | last post by:
I need to programmatically invoke from other class Click event of the Button on my Form. Button.OnClick method is protected, not public. How to perform this ? Oleg Subachev
3
by: Robert W. | last post by:
I'm new to ASP.net programming so excuse my ignorance if the following question seems overly simplistic. I've created a simple Login form with 3 primary WebControls: - A TextBox for the Username...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.