Cannot resize button from the theme

4 posts, 0 answers
  1. Dannie
    Dannie avatar
    2 posts
    Member since:
    Aug 2012

    Posted 24 Aug 2012 Link to this post

    Hi,

    I was trying to resize the radbutton to be larger in visual style builder so that when I swith theme both text and button can be bigger. I was managed to set the text with a bigger font size but couldn't find a way to make radbutton bigger. When my winform app runs the text on the button is truncated since it's set bigger. I tried minsize on rootradelement, radbuttonelement and elements further down, still doesn't work. Please advise.


    Thank you, 
    Dannie
  2. Boryana
    Admin
    Boryana avatar
    330 posts

    Posted 29 Aug 2012 Link to this post

    Hi Dannie,

    Thank you for contacting us.

    You can set the size of a RadButton through theme using the following steps:
    1. Open Visual Style Builder and load the theme you would like to use. In case you would like to change a predefined theme please have a look at this article: Loading predefined themes.
    2. In the Controls Structure pane navigate to RadButton >> RadButtonElement and select the RadButtonElement node. 3. In the Elements pane expand the RadButtonElement node and find the MinSize property. Set it to the size you find appropriate for your scenario.
    4. Save the theme and load it in your application. Here are several articles that might be helpful:  Saving and Loading Theme Files, Loading Themes from an External File, Loading Themes from a Resource, Applying Theme to a Control.
    5. Add a line to your code that sets the AutoSize property of the RadButton control to true. Here is a sample snippet:
    this.radButton1.AutoSize = true;

    The attached sample project demonstrates the aforementioned approach. I hope you will find it helpful.

    Let me know if you have any further queries.

    Regards,
    Boryana
    the Telerik team
    RadControls for WinForms Q2'12 release is now live! Check out what's new or download a free trial >>
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Dannie
    Dannie avatar
    2 posts
    Member since:
    Aug 2012

    Posted 29 Aug 2012 Link to this post

    Hi Boryana,

    Thank you for your advise and your solution works for radbutton. However, this issue still exists for raddropdownbutton where there is no autosize property. Please help.


    Regards,
    Dannie
  5. Boryana
    Admin
    Boryana avatar
    330 posts

    Posted 03 Sep 2012 Link to this post

    Hello Dannie,

    Thank you for writing back.

    The approach I suggested does not work for RadDropDownButton indeed. I have logged this issue to our Public Issue Tracker under ID 12526. To subscribe for its status updates please follow this link: http://www.telerik.com/support/pits.aspx#/public/winforms/12526. Thank you for the report and please excuse us for the caused inconvenience. We will do our best to address the issue in our next official release. Your Telerik points have been updated.

    One approach to avoid the issue is through replacing the AutoSize setting with the following three lines: 
    this.radDropDownButton1.RootElement.StretchHorizontally = false;
    this.radDropDownButton1.RootElement.StretchVertically = false;
    this.radDropDownButton1.RootElement.SaveCurrentStretchModeAsDefault();

    The modified version of the sample project demonstrates the above suggestion. I hope you will find it useful.

    Please let me know if you experience any further issues. I will do my best to assist you.

    Regards,
    Boryana
    the Telerik team
    RadControls for WinForms Q2'12 release is now live! Check out what's new or download a free trial >>
Back to Top