This is a migrated thread and some comments may be shown as answers.

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

3 Answers 102 Views
Themes and Visual Style Builder
This is a migrated thread and some comments may be shown as answers.
Barkha
Top achievements
Rank 1
Barkha asked on 18 Oct 2007, 08:21 PM
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

3 Answers, 1 is accepted

Sort by
0
Dwight
Telerik team
answered on 19 Oct 2007, 07:20 AM
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
0
Barkha
Top achievements
Rank 1
answered on 19 Oct 2007, 10:06 PM
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
0
Dwight
Telerik team
answered on 22 Oct 2007, 12:12 PM
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
Tags
Themes and Visual Style Builder
Asked by
Barkha
Top achievements
Rank 1
Answers by
Dwight
Telerik team
Barkha
Top achievements
Rank 1
Share this question
or