RADButton Circle

2 posts, 1 answers
  1. BB
    BB avatar
    13 posts
    Member since:
    Mar 2007

    Posted 12 Mar 2011 Link to this post

    I need a RADButton which is round like a circle and an Image in it.

    Thank you very much.

  2. Answer
    Richard Slade
    Richard Slade avatar
    3000 posts
    Member since:
    May 2009

    Posted 14 Mar 2011 Link to this post

    Hello,

    To do this, first create a rounded button
    using Telerik.WinControls.UI;
    using Telerik.WinControls;
      
    public class RoundButton : RadButton
    {
        public RoundButton()
            : base()
        {
      
        }
      
        public override string ThemeClassName
        {
            get
            {
                return typeof(RadButton).FullName;
            }
        
      
      
        protected override void OnLoad(System.Drawing.Size desiredSize)
        {
            Telerik.WinControls.EllipseShape circle = new EllipseShape();
      
            this.ButtonElement.Shape = circle;
      
            base.OnLoad(desiredSize);
        }
    }

    and then give your rounded button an image
    this.roundButton1.Size = new Size(81, 74);
    this.roundButton1.DisplayStyle = Telerik.WinControls.DisplayStyle.Image;
    this.roundButton1.Image = // some round image

    hope that helps
    Richard
  3. UI for WinForms is Visual Studio 2017 Ready
Back to Top