473,396 Members | 1,968 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Understanding Cursors

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
5 1470
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Alban Hertroys | last post by:
Oh no! It's me and transactions again :) I'm not really sure whether this is a limitation of psycopg or postgresql. When I use multiple cursors in a transaction, the records inserted at the...
22
by: T.S.Negi | last post by:
Hi All, I want to avoid using cursors and loops in stored procedures. Please suggest alternate solutions with example (if possible). Any suggestion in these regards will be appreciated. ...
5
by: Todd Huish | last post by:
I have noticed something disturbing when retrieving datasets over a relatively slow line (multiple T1). I am looking at about 25 seconds to retrieve 500 rows via a php-odbc link. This same select...
6
by: a | last post by:
Hello, I am doing some multithreading in an MDI app, and I can't seem to get the cursor to stay as an Hourglass. I call: Cursor.Current = cursors.wait at the beginning of my routing, and...
10
by: Just Me | last post by:
Does Me.Cursor.Current=Cursors.WaitCursor set the current property of Me.Cursor to Cursors.WaitCursor And Me.Cursor.Current=Cursors.Default set the Me.Current property to something (default)...
2
by: Alex | last post by:
In the code below, clicking on the button ButtonChangeCursor changes the form's cursor to a WaitCursor. Clicking the button ButtonRestoreCursor changes the form's cursor back to its original...
7
by: H. Williams | last post by:
I know the .Net Cursor class doesn't work with color cursors. So I'm currently using the LoadCursorFromFile API with reflection to set color cursors: here is my code: public static extern...
3
by: schwartzenberg | last post by:
Dear friends, I have just run into a strange DB2 problem. Something i'd some of you would answer, if only shortly. My basic question is: How do i ensure 'insensitive' (ie static) cursors...
1
by: Dima Kuchin | last post by:
Hello, I was trying to find the information about when and where should I use cursors in DB2, no luck. Maybe you can point me to some article that describes just that (or tell me which page is...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
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,...
0
tracyyun
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.