Toggle button style

6 posts, 0 answers
  1. Marcin
    Marcin avatar
    5 posts
    Member since:
    Jul 2008

    Posted 18 Feb 2009 Link to this post

    Hi,
    how can I change toggle button style that it looks like RadButtonElement (etc. border,background). When i try do something in edit ui element etc changing background disabled on mouse over style. Can I edit ToggleButton in Theme Builder?

    Thanks
    Marcin
  2. Victor
    Admin
    Victor avatar
    1351 posts

    Posted 20 Feb 2009 Link to this post

    Hi Marcin,

    Thank your for writing.
    You can :). The builder is indeed what you should use. Here is the documentation for the Theme Builder (Note that Visual Style Builder and Theme Builder are the same thing). Here are also some movies on VSB(VisualStyleBuilder) that you can watch.
    I hope this will be useful to you. Please write back if you have other questions.

    Regards,
    Victor
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Marcin
    Marcin avatar
    5 posts
    Member since:
    Jul 2008

    Posted 20 Feb 2009 Link to this post

    Dear Victor,
    Thakns for replay. I still cannot figure out how to change style of toggle button. In tutorial somebody created ribbon bar that looks exactly the same like in theme builder. It has few chunks and RadButtonElements but no togglebutton. When i open theme builder i see exactly the same ribbon bar like in tutorial. So how can i change style of toggle button if there is no button of this type?

    Regards,
    Marcin
  5. Victor
    Admin
    Victor avatar
    1351 posts

    Posted 23 Feb 2009 Link to this post

    Hello Marcin,

    Thank you for writing. I have attached a few screenshots:

    Screenshot 1 shows how to load the Toggle Button.
    Screenshot 2 shows the property grid where you can edit various button properties and states that the button can be in (pressed, hovered etc.).
    In screenshot 3 I have highlighted the the theme name field as it is important to give your theme a name once you decide to save your work.

    I hope this will be helpful. Please write back if you need further assistance.

    Regards,
    Victor
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  6. Marcin
    Marcin avatar
    5 posts
    Member since:
    Jul 2008

    Posted 23 Feb 2009 Link to this post

    Hi Victor,
    maybe i didn't explain what is my problem :-) .
    Telerik.WinControls.UI.RadToggleButtonElement - instance of this class can be nested in other controls like RibbonBar. Doesn't exposes properties like ThemeName
     Telerik.WinControls.UI.RadToggleButton - wrapper for RadToggleButtonElemen. Implements additional functionalites and exposes properties like ThemeNane

    So class Telerik.WinControls.UI.RadToggleButtonElement doen't have properties like ThemeName so i cannot apply theme for instace of this class but i can do it for instance of class Telerik.WinControls.UI.RadToggleButton (like you showed in screens). I assume that clas RadToggleButton is wrapper for RadToggleButtonElement that implements additional functionalities and exposes properties like ThemeName. But collection of elements that are diplayed in ribbonbar doesn't let us to add instance of class Telerik.WinControls.UI.RadToggleButton only RadToggleButtonElement  is allowed. So how can apply theme for object that doesn't have properties ThemeName?

    Regards,
    Marcin
  7. Victor
    Admin
    Victor avatar
    1351 posts

    Posted 26 Feb 2009 Link to this post

    Hi Marcin,

    Thank you for writing. Please excuse me for the misunderstanding. This can be done by adding a style sheet relation to your toggle button theme xml file. After you create your theme, open the xml in VisualStudio and collapse the BuilderData tag. Then you should see a <StyleRelations> tag and some relations inside. Replace the last relation with this one:

    <RadStylesheetRelation ControlType="Telerik.WinControls.UI.RadRibbonBar" ElementType="Telerik.WinControls.UI.RadToggleButtonElement" />

    There is one more thing that needs to be done. While you are still in the xml file, change the theme name (second line in the file) to the theme you have currently set to the ribbon. For example, if your ribbon is using the "ControlDefault" theme you have to change the theme name of your toggle button theme to "Control Default".

    After you do this, load your theme and tell me if this worked. I am looking forward to your reply.

    Greetings,
    Victor
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
Back to Top
UI for WinForms is Visual Studio 2017 Ready