Not able to apply FillPrimitive - BackColor to the RadButton through visualStyleBuilder

4 posts, 0 answers
  1. Barkha
    Barkha avatar
    29 posts
    Member since:
    Oct 2007

    Posted 18 Oct 2007 Link to this post

    Hi All,

    Am just doing a simple exercise of creating a new theme for the radButton.

    These are the steps am following
    1) Open the VisualStyle Builder.
    2) Load the RadButton control.
    3) Select on FillPrimitive of the RadButtonElement and change the BackColor, BackColor2, BackColor3 , BackColor4 from default blue to anyother color.

    Now at this stage I dont see any change in the color of the button.

    However, If I change the Text:RadButton property under ImageAndTextLayoutPanel then I definitely see the change in the color of the text "RadButton" to whatever I select.
    I can also apply different color to the button on IsMouseOverButton.

    Why am I not able to see any change in the color of the button from standard blue to any selected one?

    Looking forward for your reply.

    Thanks
    -barkha
  2. Dwight
    Admin
    Dwight avatar
    475 posts

    Posted 19 Oct 2007 Link to this post

    Hello Barkha,

    I assume that you are modifying the Initial State. This state has special meaning in our framework. Currently it will be better to leave this state as is. Instead, modify the !IsMouseOver state.

    If you have further troubles using the Visual Style Builder, just write us. We will be glad to help.

    Best,
    Evtim
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Barkha
    Barkha avatar
    29 posts
    Member since:
    Oct 2007

    Posted 19 Oct 2007 Link to this post

    thanks Evtim. I would appreciate if you can explain me the importance of not changing the initial state. Should we never touch the initial state of any controls because in your "Creating a Custome Theme" example, we are changing the initial state of some of the controls.

    -Barkha
  5. Dwight
    Admin
    Dwight avatar
    475 posts

    Posted 22 Oct 2007 Link to this post

    Hello Barkha,

    You can freely change the initial state as you like. What you should know is that this state is applied only once, when the control is loaded. After that, the only the other states are applied. What happens in your case is that the Initial state is applied on button creation, but right after that the !IsMouseOver state is applied. In fact, the states are applied from left to right, if their condition is true. The last one will take precedence as it will be applied last.

    Consider having two conditions: IsMouseOver and IsMouseOver & IsPressed.
    Then, when you hover the button and press it, the first state will be applied as it is true (IsMouseOver = true). Then the second one will be applied as it is again true.

    Now, if you swap the two conditions so that IsMouseOver & IsPressed is before IsMouseOver, they will be applied in the opposite order, so IsMouseOver will take precedence. Then it will look like the first one is not applied, i.e. there will be no pressed-button state.

    That applies to the Initial state too. It will always be applied first, as it appears first in the list. It is applied, but right after that some other state is applied. And, again, the initial state is applied only once. While the rest of the states are applied on each state change (mouse hover, button press, etc.)

    I hope this information will help you understand the Visual Style Builder and our theming system. If you have any additional questions, don't hesitate to ask.

    Regards,
    Evtim
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
Back to Top