Flat Button

4 posts, 0 answers
  1. Sperduti
    Sperduti avatar
    16 posts
    Member since:
    Oct 2007

    Posted 29 Nov 2007 Link to this post

    Is there any way to apply Flat style on RadButton element ?

    Regards,

    YSP
  2. Sperduti
    Sperduti avatar
    16 posts
    Member since:
    Oct 2007

    Posted 30 Nov 2007 Link to this post

    If I select Plain theme and the same backcolor than my parent form, I can have flat rad button style. But there isn't another way ?

    Thanks,

    YSP
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Nikolay
    Admin
    Nikolay avatar
    1803 posts

    Posted 30 Nov 2007 Link to this post

    Hello Sperduti,

    Yes, there are two ways to apply flat style for RadButton:
    1. Set it programmatically. Just put the following code snippet in the Form_Load event handler:
       
      // Set the RadButton color gradient style to solid  
      (radButton1.RootElement.Children[0].Children[0] as FillPrimitive).GradientStyle = GradientStyles.Solid;  
       
      // Set the solid color to a color of your choice (in this case trasparent)  
      (radButton1.RootElement.Children[0].Children[0] as FillPrimitive).BackColor = Color.Yellow;  
       
      // In case you want to hide the border, choose between these two lines:  
      (radButton1.RootElement.Children[0].Children[2] as BorderPrimitive).Visibility = ElementVisibility.Hidden;  
      (radButton1.RootElement.Children[0].Children[2] as BorderPrimitive).ForeColor = Color.Transparent; 

    2. Use Visual Style Builder to make a theme. In the Control Structure panel navigate to RootRadElement >> RadButtonElement >> FillPrimitive. Then change the GradientStyle to Solid and set a color for each of the RadButton states.
      For more info on using Visual Style Builder, please take a look at these video tutorials:
      Visual Style Builder I
      Visual Style Builder II

    If you have further questions, do not hesitate to contact us.
     

    All the best,

    Nikolay

    the Telerik team


    Instantly find answers to your questions at the new Telerik Support Center
  5. JigneshGN
    JigneshGN avatar
    10 posts
    Member since:
    May 2009

    Posted 09 Feb 2010 Link to this post

    Hi,

    I had same confusion.

    I solved my problem following your steps.

    Thank you.
Back to Top