Change cursor in a Class Library

  • Thread starter Thread starter GatorBait
  • Start date Start date
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
 
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
 
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
 
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.
 
Back
Top