Cursor on RadLabelElement

6 posts, 1 answers
  1. Erik
    Erik avatar
    80 posts
    Member since:
    Jul 2007

    Posted 12 Aug 2008 Link to this post

    Hi telerik,

    In RadPanelBar, I added dynamically RadLabelElement. Try to set the cursor but i couldnt do it.

    How do i set the cursor?

    Thanks
  2. Boyko Markov
    Admin
    Boyko Markov avatar
    610 posts

    Posted 13 Aug 2008 Link to this post

    Hi Erik,

    Thank you about contacting me.

    There is a class named Cursor. This class has a property named Current and using this property you can change the cursor. Here is a sample code showing how to change a cursor:

    Cursor.Current = Cursors.Hand;


    I hope I got you correctly, however if you have more questions please don't hesitate to write me back.

    Greetings,
    Boyko Markov
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Erik
    Erik avatar
    80 posts
    Member since:
    Jul 2007

    Posted 13 Aug 2008 Link to this post

    Thanks for the reply.

    In radLabel, we can set RadLabel.cursor=cursor.hand
    but not in RadLabelElement.

    How do i set cursor for RadLabelElement? Thanks so much for your help.
  5. Answer
    Boyko Markov
    Admin
    Boyko Markov avatar
    610 posts

    Posted 13 Aug 2008 Link to this post

    Hello Erik,

    Here is some code which you can use:

    1. Subscribe to the MouseEnter and MouseLeave events of RadLabelElement

           this.radLabelElement1.MouseEnter += new EventHandler(radLabelElement1_MouseEnter);
           this.radLabelElement1.MouseLeave += new EventHandler(radLabelElement1_MouseLeave);

     
    2. In the event handlers set the Cursor property.
      void radLabelElement1_MouseLeave(object sender, EventArgs e)
            {
                this.radLabelElement1.ElementTree.Control.Cursor = Cursors.Arrow;
            }

            void radLabelElement1_MouseEnter(object sender, EventArgs e)
            {
                this.radLabelElement1.ElementTree.Control.Cursor = Cursors.Hand;
            }

    Note that you can access the parent control of every RadElement when the Visual tree is build.

    I'll be glad to help if you have other questions.


    Sincerely yours,
    Boyko Markov
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  6. Erik
    Erik avatar
    80 posts
    Member since:
    Jul 2007

    Posted 13 Aug 2008 Link to this post

    Thanks for the answer. It's solved the problem.
  7. Boyko Markov
    Admin
    Boyko Markov avatar
    610 posts

    Posted 14 Aug 2008 Link to this post

    Hi Erik,

    I'm glad to see that everything works fine now.
    Do not hesitate to write me back if something else pops up.

    Best wishes,
    Boyko Markov
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Back to Top
UI for WinForms is Visual Studio 2017 Ready