This is a migrated thread and some comments may be shown as answers.

Cannot resize button from the theme

3 Answers 245 Views
Buttons, RadioButton, CheckBox, etc
This is a migrated thread and some comments may be shown as answers.
Dannie
Top achievements
Rank 1
Dannie asked on 24 Aug 2012, 11:06 PM
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

3 Answers, 1 is accepted

Sort by
0
Boryana
Telerik team
answered on 29 Aug 2012, 09:56 AM
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 >>
0
Dannie
Top achievements
Rank 1
answered on 29 Aug 2012, 08:42 PM
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
0
Boryana
Telerik team
answered on 03 Sep 2012, 08:36 AM
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 >>
Tags
Buttons, RadioButton, CheckBox, etc
Asked by
Dannie
Top achievements
Rank 1
Answers by
Boryana
Telerik team
Dannie
Top achievements
Rank 1
Share this question
or