By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,933 Members | 1,243 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,933 IT Pros & Developers. It's quick & easy.

Understanding Cursors

P: n/a
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


Nov 16 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
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.

"Just Me" wrote:
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


Nov 16 '05 #2

P: n/a
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" <Ph**********@discussions.microsoft.com> wrote in message
news:D7**********************************@microsof t.com...
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.

"Just Me" wrote:
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


Nov 16 '05 #3

P: n/a
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" <Ph**********@discussions.microsoft.com> wrote in message
news:D9**********************************@microsof t.com...
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.
Regards,
Phil.

"Just Me" wrote:
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" <Ph**********@discussions.microsoft.com> wrote in message news:D7**********************************@microsof t.com...
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.

"Just Me" wrote:

> 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
>
>
>
>
>
>
>


Nov 16 '05 #4

P: n/a
What happen if you use System.IO.File.Copy / Delete / Move instead of SHFileOperation?
"Just Me" wrote:
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" <Ph**********@discussions.microsoft.com> wrote in message
news:D9**********************************@microsof t.com...
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.

Regards,
Phil.

"Just Me" wrote:
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" <Ph**********@discussions.microsoft.com> wrote in message news:D7**********************************@microsof t.com...
> 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.
>
> "Just Me" wrote:
>
> > 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
> >
> >
> >
> >
> >
> >
> >


Nov 16 '05 #5

P: n/a
That works OK

Thanks

"Phil Williams" <Ph**********@discussions.microsoft.com> wrote in message
news:22**********************************@microsof t.com...
What happen if you use System.IO.File.Copy / Delete / Move instead of SHFileOperation?

"Just Me" wrote:
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" <Ph**********@discussions.microsoft.com> wrote in message news:D9**********************************@microsof t.com...
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.

Regards,
Phil.

"Just Me" wrote:

> 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" <Ph**********@discussions.microsoft.com> wrote in

message
> news:D7**********************************@microsof t.com...
> > 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.
> >
> > "Just Me" wrote:
> >
> > > 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
> > >
> > >
> > >
> > >
> > >
> > >
> > >
>
>
>


Nov 16 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.