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

ImageScalinSize property on buttons

1 Answer 52 Views
Buttons, RadioButton, CheckBox, etc
This is a migrated thread and some comments may be shown as answers.
ISB-developer
Top achievements
Rank 2
ISB-developer asked on 22 Aug 2011, 07:02 AM
Hi, I have a button and I have setted up an image that is bigger than the button.
Is there a posibility from ImageScalingSize property to display the image at the same size like the button is?

Also I have attached an image
Thanks

1 Answer, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 24 Aug 2011, 02:31 PM
Hello,

Thank you for writing.

The desired functionality is achievable. Set the BackgroundImage property of RadButton (instead of the Image property) and then set the BackgroundImageLayout property to Zoom or Stretch. One more thing that you have to do is hide the button FillPrimitive in order to make the BackgroundImage visible. Here is a sample implementation:
radButton1.ButtonElement.ButtonFillElement.Visibility = Telerik.WinControls.ElementVisibility.Collapsed;
radButton1.BackgroundImage = Image.FromFile(@"C:\Program Files (x86)\Telerik\RadControls for WinForms Q2 2011\Examples\QuickStart\Resources\01.png");
radButton1.BackgroundImageLayout = ImageLayout.Zoom;//or Stretch

I hope that you find this information helpful. Should you have any other questions, do not hesitate to contact us.
 
Greetings,
Stefan
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

Tags
Buttons, RadioButton, CheckBox, etc
Asked by
ISB-developer
Top achievements
Rank 2
Answers by
Stefan
Telerik team
Share this question
or