WaitCursor
-
I have a gui app which runs a long process on a worker thread. When the thread starts the long running process fires an event which is picked up by the gui thread and sets the Cursor.Current to the WaitCursor - when the long process has finished it fires another event and Cursor.Current is set to the default cursor. Unfortunately the cursor never becomes the WaitCursor - I can test the Cursor.Current.ToString() and it says it's the WaitCursor - but it isn't, just the default cursor. Why is that?
-
I have a gui app which runs a long process on a worker thread. When the thread starts the long running process fires an event which is picked up by the gui thread and sets the Cursor.Current to the WaitCursor - when the long process has finished it fires another event and Cursor.Current is set to the default cursor. Unfortunately the cursor never becomes the WaitCursor - I can test the Cursor.Current.ToString() and it says it's the WaitCursor - but it isn't, just the default cursor. Why is that?
Maybe you need to call
Application.DoEvents()
[^] to actually dispatch the correct Windows messages to switch the cursor?!? -- Affordable Windows-based CMS: www.zeta-producer.com -
Maybe you need to call
Application.DoEvents()
[^] to actually dispatch the correct Windows messages to switch the cursor?!? -- Affordable Windows-based CMS: www.zeta-producer.com -
I tried doing that - it didn't do anything other than mess up the threads. Thanks for your reply though
If your GUI is truely idle, then you wouldn;t have to call DoEvents at all. But if you're GUI is doing something, like blocking while your waiting for a thread to complete, then DoEvents can do strange things. It sounds like you haven't done something correctly, but without further information and code samples, it's impossible to tell you what that is. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
-
I have a gui app which runs a long process on a worker thread. When the thread starts the long running process fires an event which is picked up by the gui thread and sets the Cursor.Current to the WaitCursor - when the long process has finished it fires another event and Cursor.Current is set to the default cursor. Unfortunately the cursor never becomes the WaitCursor - I can test the Cursor.Current.ToString() and it says it's the WaitCursor - but it isn't, just the default cursor. Why is that?
Are you sure the event is on the GUI thread? You might want to check using InvokeRequired property; if an invoke is required, that would explain why the cursor setting doesn't seem to be working.
Tech, life, family, faith: Give me a visit. I'm currently blogging about: He has a funny face. And he's my son. Judah Himango
-
Are you sure the event is on the GUI thread? You might want to check using InvokeRequired property; if an invoke is required, that would explain why the cursor setting doesn't seem to be working.
Tech, life, family, faith: Give me a visit. I'm currently blogging about: He has a funny face. And he's my son. Judah Himango
I HAVE A SIMILAR PROBLEM i am havig a list view and i dynamically tried to cange the cursor to waiting cursor, but it does not work. then i tried changing the cursor from the property of the list view but it does not work either.
-
If your GUI is truely idle, then you wouldn;t have to call DoEvents at all. But if you're GUI is doing something, like blocking while your waiting for a thread to complete, then DoEvents can do strange things. It sounds like you haven't done something correctly, but without further information and code samples, it's impossible to tell you what that is. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
I HAVE A SIMILAR PROBLEM i am havig a list view and i dynamically tried to cange the cursor to waiting cursor, but it does not work. then i tried changing the cursor from the property of the list view but it does not work either.