RadButton's Border does not show

2 posts, 0 answers
  1. Jason
    Jason avatar
    2 posts
    Member since:
    Nov 2015

    Posted 03 Dec 2015 Link to this post

    I have set the button's top border color to be red and bottom border color to be yellow by the below codes but the appearance never show the border colors when running.

                this.ButtonElement.BorderElement.BoxStyle = BorderBoxStyle.FourBorders;
                this.ButtonElement.BorderElement.TopColor = Color.Red;
                this.ButtonElement.BorderElement.TopWidth = 2;
                this.ButtonElement.BorderElement.BottomColor = Color.Yellow;
                this.ButtonElement.BorderElement.BottomWidth = 2;

    Please help me to solve this problem.

  2. Ralitsa
    Admin
    Ralitsa avatar
    176 posts

    Posted 03 Dec 2015 Link to this post

    Hi Jason,

    Thank you for contacting us.

    You need to set the PaintUsingParentShape property to false. Please refer to the example below how to achieve it: 
    this.radButton1.ButtonElement.BorderElement.PaintUsingParentShape = false;
    this.radButton1.ButtonElement.ShowBorder = true;
    this.radButton1.ButtonElement.BorderElement.BoxStyle = BorderBoxStyle.FourBorders;
    this.radButton1.ButtonElement.BorderElement.TopColor = Color.Red;
    this.radButton1.ButtonElement.BorderElement.TopWidth = 2;
    this.radButton1.ButtonElement.BorderElement.BottomColor = Color.Yellow;
    this.radButton1.ButtonElement.BorderElement.BottomWidth = 2;
    this.radButton1.ButtonElement.BorderElement.LeftColor = Color.Blue;
    this.radButton1.ButtonElement.BorderElement.LeftWidth = 3;
    this.radButton1.ButtonElement.BorderElement.RightColor = Color.Green;
    this.radButton1.ButtonElement.BorderElement.RightWidth = 3;

    In the attachments you can find an image demonstrating the result on my end.

    Should you have further questions, I would be glad to help. 

    Regards,
    Ralitsa
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. UI for WinForms is Visual Studio 2017 Ready
Back to Top