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(B yVal sender As System.Object, ByVal e As
System.EventArg s) Handles Button1.Click
Me.Cursor = Cursors.WaitCur sor
Textbox1.text = Now.Tostring
System.Threadin g.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 9 4902
"DotNetShad ow" <ro*********@ne tscape.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
Hi Roberto,
A question like this has been yesterday also in this newsgroup
the answer is make the textbox1.enable d = 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(B yVal sender As System.Object, ByVal e As System.EventArg s) Handles Button1.Click Me.Cursor = Cursors.WaitCur sor Textbox1.text = Now.Tostring System.Threadin g.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
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.enable d = 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
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******* ******@TK2MSFTN GP12.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.enable d = 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
"DotNetShad ow" <ro*********@ne tscape.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
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
* "Armin Zingler" <az*******@free net.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>
"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 This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
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 so that
the people who visit the web page see a neon arrow (example) as
opposed to what they see now (which is the white arrow) Any Ideas? Its
driving me batty.
Many thanks
|
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 with that square. The squares are
PictureBoxes with images of the pieces set to the pBox's
image property.
I am having trouble with changing the mouse pointer to a
custom mouse pointer during drag and drop operations. I
have checked several...
|
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
javascript) don't disappear when the mouse moves outside of the area of
the menues (some of the menues are nested two and three levels). As
long as the mouse cursor remains *within* the options of the menues,
the option under the mouse cursor is...
|
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 fine, except that any mouse events generated during
this wait period (such as clicking on a button, etc.), get processed once the
processing is complete. For example, while waiting for my task to complete,
I click on a button (even though the...
|
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 the
"MouseMove" event for that textbox.
Thanks
| |
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 on pixel.
<html>
<body>
<script type = 'text/javascript'>
function show_hourglass() {
document.getElementById("my_href1").style.cursor = "wait";
document.getElementById("my_href2").style.cursor = "wait";
|
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 region). The image map is
created in javascript, but doesn't set any 'cursor' style rules.
The problem I'm having is I have two images embedded inside two divs. The
outer div has style='... cursor:crosshair', but when I move over the image...
|
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 where my application do something
Windows.Forms.Cursor.Current = Cursors.WaitCursor ??
something is for example calling the sql-server database to get/set data
please help me
|
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 movement. So when user stops moving mouse, 20ms later the cursor itself stops
moving...
I tried using:
Windows.Forms.Cursor.Current.Position = New System.Drawing.Point(x,y)
and forms of sleep/timer events but cant seem to get it to work...
|
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
| |
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |