Understanding Cursors

  • Thread starter Thread starter Just Me
  • Start date Start date
J

Just Me

I have a UserControl that contains a few controls on it.

If when one of the buttons is clicked I want to, in the click event, set the
cursor to
Cursor = Cursors.WaitCursor

I want the cursor to change everywhere on the UserControl.

Do I have to loop over the UserControl's Control collection and set each
control's cursor?



Suppose I want the entire form containing the usercontrol to display a
WaitCursor, do I need to raise an event and have the form loop over all it's
controls?





Thanks in advance
 
Just set the Cursor for the usercontrol to Cursors.WaitCursor. If you want to change the cursor for the whole form, set the forms Cursor property.

Regards,
Phil.
 
I have two similar situations in which I did just that.
In one case I see the WaitCursor even as I move over controls on the
UserControl.
In the other I see the WaitCursor over one of the controls but not over the
others.
I've been looking to see if I could see something different about the
controls that do not show the WaitCursor but can find nothing>

Have any idea what could cause that to happen??

Thanks for the response

Phil Williams said:
Just set the Cursor for the usercontrol to Cursors.WaitCursor. If you
want to change the cursor for the whole form, set the forms Cursor property.
 
I did what you said and while single stepping found the problem.
Don't know why but executing
SHFileOperation(FileOperation)

Change the cursor to Default.

I set the cursor right after and that fixed it.

Is there something I should know - like API calls resets the cursor??





Thanks for the help



Phil Williams said:
I tried to reproduce your problem, but cannot.

When you get the wait cursor showing just over the one control, try
checking the Cursor property for that control. If it is set to
Cursors.WaitCursor, try adding a CursorChanged event handler to the control.
Use the event handler to find the line of code which changes the Cursor
property to Cursors.WaitCursor.
 
What happen if you use System.IO.File.Copy / Delete / Move instead of SHFileOperation?
 
Back
Top