Change cursor in a Class Library

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • GatorBait

    Change cursor in a Class Library

    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.WaitCur sor 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

  • Armin Zingler

    #2
    Re: Change cursor in a Class Library

    "GatorBait" <MPotok@gmail.c om> schrieb[color=blue]
    > 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.WaitCur sor and Cursor = Cursors.Arrow, but the
    > class library does not seem to know what the Cursors class is. Can
    > someone help?[/color]


    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.Cu rrent property. It will only stay as long as
    the application is not idle. See <f1> for Cursor.Current.


    Armin

    Comment

    • Rick Mogstad

      #3
      Re: Change cursor in a Class Library


      "GatorBait" <MPotok@gmail.c om> wrote in message
      news:1122904450 .469985.22370@g 43g2000cwa.goog legroups.com...[color=blue]
      > 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.WaitCur sor and Cursor = Cursors.Arrow, but the class
      > library does not seem to know what the Cursors class is. Can someone
      > help?[/color]



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


      Comment

      • Rick Mogstad

        #4
        Re: Change cursor in a Class Library


        "GatorBait" <MPotok@gmail.c om> wrote in message
        news:1122904450 .469985.22370@g 43g2000cwa.goog legroups.com...[color=blue]
        > 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.WaitCur sor and Cursor = Cursors.Arrow, but the class
        > library does not seem to know what the Cursors class is. Can someone
        > help?[/color]



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


        System.Windows. Forms.Cursor.Cu rrent =
        System.Windows. Forms.Cursors.W aitCursor


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


        Comment

        • GatorBait

          #5
          Re: Change cursor in a Class Library

          I got it resolved! Thank you and Armin and Rick for your help!!!

          Comment

          Working...