473,416 Members | 1,520 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,416 software developers and data experts.

Mouse Pointer Cursor and textbox

Hi Guys,

I have been having this problem recently where I have a form with a
textbox and button, if in the button event I have the following:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Me.Cursor = Cursors.WaitCursor
Textbox1.text = Now.Tostring
System.Threading.Thread.Sleep(2000) ' 2 second wait
Me.Cursor = Cursors.Arrow
End Sub

If I click the button the mouse cursor changes to an hourglass,
updates the textbox with current time and after 2 seconds the mouse
cursor returns back to the arrow The problem lies that when u click
the mouse button repeatedly even though the mouse cursor changes to an
hourglass the button is still clickable furthermore u can type text in
the textbox.

Is this the default behaviour of .NET? Is this a bug? I have even
tried disabling form elements and changing the cursor of these form
elements to hourlgass with no success can someone please help thanks

Regards DotNetShadow
Nov 20 '05 #1
9 4836
"DotNetShadow" <ro*********@netscape.net> schrieb
If I click the button the mouse cursor changes to an hourglass,
updates the textbox with current time and after 2 seconds the
mouse cursor returns back to the arrow The problem lies that when u
click the mouse button repeatedly even though the mouse cursor
changes to an hourglass the button is still clickable furthermore u
can type text in the textbox.

Is this the default behaviour of .NET?


This is the default behavior of Windows. Mouse and keyboard interaction and
other events have always been queued. Even in DOS there was a keyboard
buffer queueing the keyboard input.
--
Armin

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

Nov 20 '05 #2
Cor
Hi Roberto,

A question like this has been yesterday also in this newsgroup

the answer is make the textbox1.enabled = false

I hope this helps?

Cor
I have been having this problem recently where I have a form with a
textbox and button, if in the button event I have the following:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Me.Cursor = Cursors.WaitCursor
Textbox1.text = Now.Tostring
System.Threading.Thread.Sleep(2000) ' 2 second wait
Me.Cursor = Cursors.Arrow
End Sub

If I click the button the mouse cursor changes to an hourglass,
updates the textbox with current time and after 2 seconds the mouse
cursor returns back to the arrow The problem lies that when u click
the mouse button repeatedly even though the mouse cursor changes to an
hourglass the button is still clickable furthermore u can type text in
the textbox.

Is this the default behaviour of .NET? Is this a bug? I have even
tried disabling form elements and changing the cursor of these form
elements to hourlgass with no success can someone please help thanks

Nov 20 '05 #3
"Cor" <no*@non.com> schrieb
A question like this has been yesterday also in this newsgroup

the answer is make the textbox1.enabled = false


I think you mean button1.enabled = false, but, this wouldn't help also. The
mouse clicks will be processed after the button has been enabled again.
--
Armin

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

Nov 20 '05 #4
Cor
Hi Armin,

I saw your answer, and please see my message about what I thought it was a
bug but you say normal behaviour.

Now I know that this behaviour is known, I did not know it, but I find it
weird, no user will understand it.

Thanks anyway

Cor
A question like this has been yesterday also in this newsgroup

the answer is make the textbox1.enabled = false
I think you mean button1.enabled = false, but, this wouldn't help also.

The mouse clicks will be processed after the button has been enabled again.
--
Armin

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

Nov 20 '05 #5
Thanks for all your replies guys, just afew follow up questions:

1) So if this is the default behaviour for windows in vb6 apps would
the same problem occur?

2) How do you get around the problem? Disabling a form element will
not help since after the event occurs the mouse messages continue so
how do you cancel them?

3) Can sample code be posted to solve this problem?
Regards DotNetShadow

"Cor" <no*@non.com> wrote in message news:<ux*************@TK2MSFTNGP12.phx.gbl>...
Hi Armin,

I saw your answer, and please see my message about what I thought it was a
bug but you say normal behaviour.

Now I know that this behaviour is known, I did not know it, but I find it
weird, no user will understand it.

Thanks anyway

Cor
A question like this has been yesterday also in this newsgroup

the answer is make the textbox1.enabled = false


I think you mean button1.enabled = false, but, this wouldn't help also.

The
mouse clicks will be processed after the button has been enabled again.
--
Armin

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

Nov 20 '05 #6
"DotNetShadow" <ro*********@netscape.net> schrieb
Thanks for all your replies guys, just afew follow up questions:

1) So if this is the default behaviour for windows in vb6 apps
would the same problem occur?
yes
2) How do you get around the problem? Disabling a form element
will not help since after the event occurs the mouse messages
continue so how do you cancel them?

3) Can sample code be posted to solve this problem?


Put the work in a different thread. Your UI thread will stay responsive. In
this thread, I usually show a modal Form showing the current process and the
progress (if possible). The Form also contains a cancel button.

--
Armin

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

Nov 20 '05 #7
Cor
Hi Armin,

If you see the test I did in this newsgroup with my question if it is bug.

I could not get the unwised behaviour when I disabled the textbox instead of
making it read only.

I was thinking on that later, maybe you can try it.

Cor
Nov 20 '05 #8
* "Armin Zingler" <az*******@freenet.de> scripsit:
2) How do you get around the problem? Disabling a form element
will not help since after the event occurs the mouse messages
continue so how do you cancel them?

3) Can sample code be posted to solve this problem?


Put the work in a different thread. Your UI thread will stay responsive. In
this thread, I usually show a modal Form showing the current process and the
progress (if possible). The Form also contains a cancel button.


Something like that (C#):

<http://www.codeproject.com/cs/miscctrl/progressdialog.asp>

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #9
"Cor" <no*@non.com> schrieb

If you see the test I did in this newsgroup with my question if it is
bug.
I thought I've already answered in the other thread. Now I looked again and
saw that my reply was still in the templates folder = not sent yet. I didn't
send it because I was unsure about the "message of your message". Well, I've
sent it now but it doesn't contain much, so.....
I could not get the unwised behaviour when I disabled the textbox
instead of making it read only.
I was thinking on that later, maybe you can try it.


I'll have a look.
--
Armin

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

Nov 20 '05 #10

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

Similar topics

4
by: Videos 4 Sale | last post by:
Would you know how to change the look of a mouse pointer on a web page. On the page I have the mouse pointer is exactly as I have at work.... white. But what I want to do is change the look of it...
2
by: Tom Alcendor | last post by:
I am building a chess game application that allows a user to click on a piece and move it to a new square. When the user clicks on a piece the mouse pointer must change to the image associated...
7
by: fernandoronci | last post by:
Hi, I've been given the task of mantaining and fixing a website which I didn't design. I'm using Internet Explorer 5.5 and 6.x. Specifically, the problem is that navigation menues (written in...
2
by: KarenP | last post by:
In my Windows Forms application, while executing a process that takes some time, I am changing the cursor to the hourglass by setting Cursor.Current = Cursors.WaitCursor. This is working just...
6
by: Andrea V.F. | last post by:
How can I determine the control under the mouse cursor when a user muves the mouse?? For example if the user moves the cursor over a textbox i would receive the name of that textbox without using...
1
by: Stefan Mueller | last post by:
With the following code I can change the mouse pointer. However, if you click in Mozilla (with IE it works perfect) on 'Show hourglass' the mouse pointer changes only if you move the mouse at least...
1
by: Andy Baxter | last post by:
hello, I'm writing a panoramic image viewer in javascript. When the mouse is over the image, I want it to be a crosshair (over most of the image), or a hand/pointer (when it's over an image map...
6
by: Jan Heppen | last post by:
Is it posible to set something so that when my vb.net (visual studio 2005, framework 2.0) application is busy that the mouse pointer change into a hourglass ? Or do i have to set everywhere...
6
by: c.k. | last post by:
I was wondering if there was a way to give mouse movement on an empty form some lag/delay? For instance, user moves mouse, and the cursor is 20ms (possible adjustable from some option) behind the...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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,...
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.