AutoSize of radbutton

7 posts, 1 answers
  1. Renato Lopes
    Renato Lopes avatar
    13 posts
    Member since:
    Sep 2007

    Posted 04 Aug 2008 Link to this post

    Hi.

    I'm using a radbutton with a image. When I try to customize the UI element, if I Change the AutoSize property to False of the Text Layout, so I can use the Location to change the position of the text in the button, the text doesn't show when running my application. If I change the location with the AutoSize True, the text shows, but in the wrong place. Can you give me a solution?

    Thanks
  2. Martin Vasilev
    Admin
    Martin Vasilev avatar
    1061 posts

    Posted 05 Aug 2008 Link to this post

    Hi Renato Lopes,

    Thank you for writing.

    I am afraid that I cannot understand your scenario in details. Please, give me a step-by-step how-to for reproducing the issue. It would also help me if describe what exactly is your goal.  

    I am looking forward to your reply.

    Greetings,
    Martin Vasilev
    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. Renato Lopes
    Renato Lopes avatar
    13 posts
    Member since:
    Sep 2007

    Posted 06 Aug 2008 Link to this post

    hi.

    please see this video:

    http://rgomesf.googlepages.com/1.swf.html

    Hope it helps.
  5. Renato Lopes
    Renato Lopes avatar
    13 posts
    Member since:
    Sep 2007

    Posted 06 Aug 2008 Link to this post

    hi.

    please see this video:

    http://rgomesf.googlepages.com/1.swf.html

    Hope it helps.
  6. Martin Vasilev
    Admin
    Martin Vasilev avatar
    1061 posts

    Posted 08 Aug 2008 Link to this post

    Hello Renato,

    Thank you for the video.

    The text is not visible because Location property is not serialized when changes are made in design-time. You have to set it only by code. Also, it is not necessary to change the AutoSize property. If it is true, the location works like an offset (negative values are allowed) :
    this.radButton1.ButtonElement.TextElement.Location = new Point(0, 20); 

    If you have other questions, do not hesitate to contact me again.

    All the best,
    Martin Vasilev
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  7. Renato Lopes
    Renato Lopes avatar
    13 posts
    Member since:
    Sep 2007

    Posted 08 Aug 2008 Link to this post

    Hi. I try that but doesn't work. If I set AutoSize to false, the text doesn't shows even if I set the location by code. With the AutoSize set to True, text is showed ind the whong position!
  8. Answer
    Boyko Markov
    Admin
    Boyko Markov avatar
    610 posts

    Posted 08 Aug 2008 Link to this post

    Hello Renato Lopes,

    You can set any Point for a location, so you can set the value you like.
    For example you can use the following points - { new Point(10, 5), new Point(5,5), new Point(15, 15) }.

    this.radButton1.ButtonElement.TextElement.Location = new Point(0, 20); 

    Is there any particular reason for you to change the AutoSize property to false? I would suggest you use the location property to move the text where you want.

    I hope this helps.
    Please write me back if you have more questions.

    Sincerely yours,
    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