473,385 Members | 1,912 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.

ignoring mouse clicks

Currently, when my application needs to write/read to a
database, there is a time lag. In that time lag, a user
can click the same button multiple times causing my app
problems. I want to turn the mouse pointer arrow into an
hourglass and ignore mouse clicks until my app finishes
working. Most commercial apps I've looked at do this.
Is there an easy way to do this (ie. any built-in
controls in VS.NET or classes in MSDN)? Any suggestions
and/or code samples would be greatly appreciated. Thank
you for the reply.

Mike
Nov 15 '05 #1
5 2553
A lot of times that behavior is because of single threading and the app is
simply waiting for the next line to complete. You could set the button's
enabled to false and then when the proc is done, set it back to true or wait
for whatever event to occur to tell it to be enabled.

You coudl do the similar thing by setting a bool and once the button is
clicked for the first time, set it to false. On the same click event, if
not myBool Exit Sub.
"Mike" <mi*******@hotmail.com> wrote in message
news:0a****************************@phx.gbl...
Currently, when my application needs to write/read to a
database, there is a time lag. In that time lag, a user
can click the same button multiple times causing my app
problems. I want to turn the mouse pointer arrow into an
hourglass and ignore mouse clicks until my app finishes
working. Most commercial apps I've looked at do this.
Is there an easy way to do this (ie. any built-in
controls in VS.NET or classes in MSDN)? Any suggestions
and/or code samples would be greatly appreciated. Thank
you for the reply.

Mike

Nov 15 '05 #2
Mike,

Something along these lines:
-------------
Cursor = Cursors.WaitCursor;
// ... do processing
Cursor = Cursors.Arrow;
-------------

Is this what you were looking for?

Regards,
Alex
"Mike" <mi*******@hotmail.com> wrote in message
news:0a****************************@phx.gbl...
Currently, when my application needs to write/read to a
database, there is a time lag. In that time lag, a user
can click the same button multiple times causing my app
problems. I want to turn the mouse pointer arrow into an
hourglass and ignore mouse clicks until my app finishes
working. Most commercial apps I've looked at do this.
Is there an easy way to do this (ie. any built-in
controls in VS.NET or classes in MSDN)? Any suggestions
and/or code samples would be greatly appreciated. Thank
you for the reply.

Mike

Nov 15 '05 #3
On Tue, 9 Sep 2003 11:51:26 -0700, "Mike" <mi*******@hotmail.com>
wrote:
Currently, when my application needs to write/read to a
database, there is a time lag. In that time lag, a user
can click the same button multiple times causing my app
problems. I want to turn the mouse pointer arrow into an
hourglass and ignore mouse clicks until my app finishes
working. Most commercial apps I've looked at do this.
Is there an easy way to do this (ie. any built-in
controls in VS.NET or classes in MSDN)? Any suggestions
and/or code samples would be greatly appreciated. Thank
you for the reply.

when using C#, you could use teh -= operator on the Click-event (and
+= to re-subscribe after the processing)

--
NULL
Nov 15 '05 #4
That is exactly what I am looking for. Just one thing,
after I turn the cursor into a wait cursor, is there a
way to disable all the controls (e.g buttons, textboxes)
so that I can't click on anything, or do I have to
disable each control individually. Again , thanks for
the reply.
-----Original Message-----
Mike,

Something along these lines:
-------------
Cursor = Cursors.WaitCursor;
// ... do processing
Cursor = Cursors.Arrow;
-------------

Is this what you were looking for?

Regards,
Alex
"Mike" <mi*******@hotmail.com> wrote in message
news:0a****************************@phx.gbl...
Currently, when my application needs to write/read to a
database, there is a time lag. In that time lag, a user can click the same button multiple times causing my app
problems. I want to turn the mouse pointer arrow into an hourglass and ignore mouse clicks until my app finishes
working. Most commercial apps I've looked at do this.
Is there an easy way to do this (ie. any built-in
controls in VS.NET or classes in MSDN)? Any suggestions and/or code samples would be greatly appreciated. Thank you for the reply.

Mike

.

Nov 15 '05 #5
this.Enabled = false;

--
Horatiu Ripa
Software Development Manager
Business Logic Systems LTD
21 Victor Babes str., 1st floor, 3400 Cluj-Napoca, Romania
Phone/Fax: +40 264 590703
Web: www.businesslogic.co.uk

This email (email message and any attachments) is strictly confidential,
possibly privileged and is intended solely for the person or organization to
whom it is addressed. If you are not the intended recipient, you must not
copy, distribute or take any action in reliance on it. If you have received
this email in error, please inform the sender immediately before deleting
it. Business Logic Systems Ltd accepts no responsibility for any advice,
opinion, conclusion or other information contained in this email or arising
from its disclosure.

"Mike" <mi*******@hotmail.com> wrote in message
news:5d****************************@phx.gbl...
That is exactly what I am looking for. Just one thing,
after I turn the cursor into a wait cursor, is there a
way to disable all the controls (e.g buttons, textboxes)
so that I can't click on anything, or do I have to
disable each control individually. Again , thanks for
the reply.
-----Original Message-----
Mike,

Something along these lines:
-------------
Cursor = Cursors.WaitCursor;
// ... do processing
Cursor = Cursors.Arrow;
-------------

Is this what you were looking for?

Regards,
Alex
"Mike" <mi*******@hotmail.com> wrote in message
news:0a****************************@phx.gbl...
Currently, when my application needs to write/read to a
database, there is a time lag. In that time lag, a user can click the same button multiple times causing my app
problems. I want to turn the mouse pointer arrow into an hourglass and ignore mouse clicks until my app finishes
working. Most commercial apps I've looked at do this.
Is there an easy way to do this (ie. any built-in
controls in VS.NET or classes in MSDN)? Any suggestions and/or code samples would be greatly appreciated. Thank you for the reply.

Mike

.

Nov 15 '05 #6

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

Similar topics

5
by: John Champaign | last post by:
Hi all, I'm working on an educational applet for a child with special needs. He's got a bit of a trick to make my life more difficult... To interact with the applet he needs to click on...
3
by: mitsura | last post by:
Hi, I have included a small listing. The test program opens a panel and show a bitmap. What I want is to when the mouse is over the bitmap panel, I want to trap the left mouse click. The...
13
by: James Bond | last post by:
Hello. My 80+ year old father has recently decided to get his first computer. Due to his age (and I suspect lack of playing pong as a child like I did) he lacks the manual dexterity to use a mouse...
1
by: Al | last post by:
I need to write an application that couns *global* mouse clicks, i.e., mouse clicks on the entire windows screen and not this application itelf. I found something similar:...
2
by: kumar_subrahmanya | last post by:
Hi, I am facing problems in sending mouse clicks via SendInput API. Mouse clicks are being sent but at the X,Y co-ordinates. I am mapping my monitor to the (0,0,65535,65535) virtual monitor as...
4
by: Pucca | last post by:
How can I tell a mouse right clicks over a listview item that's in a container panel. I only want to display a popup menu if the user right click the mouse over an item on the Listview. I don't...
0
by: ludwig.frank | last post by:
Hi, I am attempting to detect mouse clicks from within curses, using "select" on sys.stdin. It is working great within an xterm under X, but not very well in a "real" linux console. When I click...
10
by: bern11 | last post by:
If Form1 opens Form2 modally, how do I capture clicks on Form1 when Form2 is open? I want to click on Form1 and read the mouse co-ordinates into Form2. Since Form2 is open modally, Form1...
2
by: ImageAnalyst | last post by:
Does anyone know how to get rid of excess mouse clicks? I have a button that does some code which takes some time to execute. As soon as the user clicks the button, I disable the button in the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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?
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.