2
Answers

Problems with Cursors

Administrator

Administrator

22y
457
1
I have this problem regarding with the cursor. I wanted the cursor to show a wait state (hourglass) when i load some records into the windows forms and return back to default state after the process is done. It seems to be an easy way by just issuing the statement : Cursor.Current = Cursors.WaitCursor; before the statements to be executed and then when we are done just set back the cursor to default. This works fine for the first time when that particular menu/button it is associated with is pressed or clicked. When we continue with that application and click on that menu/button again, it just doesn't show the hourglass cursor anymore. I initially thought the problem is that i didn't refresh the screen so i put a this.Refresh() command before the Cursor.Current statement but it just doesn't seems to solve the problem. If anyone knows what is the trick to solve this problem, please help me. Thanks. =CmLaM=
Answers (2)
1
Administrator

Administrator

Tech Writer 2.2k 1.6m 22y
But if that's the case ... how come when the first time the same sequence of statements are executed , it will displayed the hourglass cursor for quite a long time but when it is continuously executed for the second or third time.. it just doesn't seems to display it anymore although i can see the process after the cursor.current = cursors.defaultcursor is executing ..
1
Administrator

Administrator

Tech Writer 2.2k 1.6m 22y
are you sure that it isn't calling that line of code? it could be calling it but running through the code so fast that the cursor.current = cursors.defaultcursor; line is called before you even notice the cursor change...