ImageScalinSize property on buttons

2 posts, 0 answers
  1. ISB-developer
    ISB-developer avatar
    21 posts
    Member since:
    Jul 2011

    Posted 22 Aug 2011 Link to this post

    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
  2. Stefan
    Stefan avatar
    2891 posts

    Posted 24 Aug 2011 Link to this post


    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.
    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 >>

  3. DevCraft R3 2016 release webinar banner
Back to Top