Change cursor in a Class Library

G

GatorBait

Hi, I have created a class library that I call from within my program
using late binding. The class library contains a form and I allow the
user to do different actions on the form that is part of the class
library dll. I am having a hard time figuring out how to change the
cursor between an hourglass and arrow for those time periods when work
is being done. I have tried
Cursor = Cursors.WaitCursor and Cursor = Cursors.Arrow, but the class
library does not seem to know what the Cursors class is. Can someone
help?

Thanks a lot!

GB
 
A

Armin Zingler

GatorBait said:
Hi, I have created a class library that I call from within my
program using late binding. The class library contains a form and I
allow the user to do different actions on the form that is part of
the class library dll. I am having a hard time figuring out how to
change the cursor between an hourglass and arrow for those time
periods when work is being done. I have tried
Cursor = Cursors.WaitCursor and Cursor = Cursors.Arrow, but the
class library does not seem to know what the Cursors class is. Can
someone help?


First, it doesn't matter if it's the same assembly or another one.

Second, you can set the Form's cursor property to change the cursor
permanently. Or, you can change the shared
System.Windows.Forms.Cursor.Current property. It will only stay as long as
the application is not idle. See <f1> for Cursor.Current.


Armin
 
R

Rick Mogstad

GatorBait said:
Hi, I have created a class library that I call from within my program
using late binding. The class library contains a form and I allow the
user to do different actions on the form that is part of the class
library dll. I am having a hard time figuring out how to change the
cursor between an hourglass and arrow for those time periods when work
is being done. I have tried
Cursor = Cursors.WaitCursor and Cursor = Cursors.Arrow, but the class
library does not seem to know what the Cursors class is. Can someone
help?



I believe the Cursors namespace is in System.Windows.Forms, so you would
need to say
 
R

Rick Mogstad

GatorBait said:
Hi, I have created a class library that I call from within my program
using late binding. The class library contains a form and I allow the
user to do different actions on the form that is part of the class
library dll. I am having a hard time figuring out how to change the
cursor between an hourglass and arrow for those time periods when work
is being done. I have tried
Cursor = Cursors.WaitCursor and Cursor = Cursors.Arrow, but the class
library does not seem to know what the Cursors class is. Can someone
help?



I believe the Cursors namespace is in System.Windows.Forms, so you would
need to say


System.Windows.Forms.Cursor.Current =
System.Windows.Forms.Cursors.WaitCursor


That may not be exactly right, but you should get the idea.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top