Change CheckBox style while the control activate

4 posts, 0 answers
  1. miki
    miki avatar
    37 posts
    Member since:
    Dec 2014

    Posted 31 Dec 2014 Link to this post

    I have RadCheckBox and i am using TelerikMetroBlue theme.
    All i want to do is to change CheckBox style while the control activate, please see my attach file.

  2. Stefan
    Admin
    Stefan avatar
    2891 posts

    Posted 02 Jan 2015 Link to this post

    Hello Miki,

    Thank you for writing.

    There are two ways to customize the appearance of our controls: by using a theme or by setting the desired properties programatically.

    To achieve this appearance of the check box when checked, here is how to access the check mark primitive and set its properties:
    radCheckBox1.ButtonElement.CheckMarkPrimitive.CheckElement.DrawFill = true;
    radCheckBox1.ButtonElement.CheckMarkPrimitive.CheckElement.BackColor = Color.FromArgb(27, 161, 226);
    radCheckBox1.ButtonElement.CheckMarkPrimitive.CheckElement.BackColor2 = Color.FromArgb(27, 161, 226);
    radCheckBox1.ButtonElement.CheckMarkPrimitive.CheckElement.ForeColor = Color.FromArgb(27, 161, 226);

    The same result can be obtained with a theme. You can create your own theme, or you can use one of the predefined themes and change the appearance of the desired controls/elements. Then you can apply this theme to your application. More information about the theming mechanism is available on the following links:

    Visual Style Builder
    Working with Repository Items
    Loading predefined themes
    Saving and Loading Theme Files
    Loading Themes from an External File
    Loading Themes from a Resource
    Applying theme to a control


    I hope that you find this information useful. Should you have any other questions, do not hesitate to contact us.

    Regards,
    Stefan
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. UI for WinForms is Visual Studio 2017 Ready
  4. miki
    miki avatar
    37 posts
    Member since:
    Dec 2014

    Posted 02 Jan 2015 Link to this post

    Thanks a lot for your help.
    Please take a look at the attach screenshot, i want to change the regular style (not mouse over but just the controller style without any user click), currently the regular style is with black border and White color inside the button.
    How can i change this regular style like the second Checkbox in my screenshot ?
    I try to play with radCheckBoxLoop.ButtonElement.BorderElement properties but this default style haven't changed.
  5. Stefan
    Admin
    Stefan avatar
    2891 posts

    Posted 05 Jan 2015 Link to this post

    Hi,

    Here is how to access the fill and border elements of the check mark:
    radCheckBox1.ButtonElement.CheckMarkPrimitive.Fill.BackColor = Color.Yellow;
    radCheckBox1.ButtonElement.CheckMarkPrimitive.Fill.GradientStyle = GradientStyles.Solid;
    radCheckBox1.ButtonElement.CheckMarkPrimitive.Border.ForeColor= Color.Green;

    I hope that you find this information useful.

    Regards,
    Stefan
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
Back to Top