Hi Noel Stieglitz,
Thank you for writing.
In general, the mentioned approaches actually illustrate a different way in which you could customize our controls. There is no contradiction. You could choose one, depending on the level of detail you want to set.
1. You could change basic properties using the property grid at design-time, or accessing them at run-time programmatically. It depends on the control implementation and its current theme how this property will be taken into account. In your case, you could use the code provided below:
this.radTextBox1.BackColor = Color.Green; |
2. Sometimes, you may need to modify a property of a particular element in the hierarchy (the hierarchy can be shown at design time using the option "Edit UI elements" in the ActionList). The forum’s topic gave information how to change the Background color of the FillPrimitive element of RadButtonControl. Actually, your example code is doing the same. However, there is a difference in changing background of RadTextBox. You should change the BackColor property of the RadTextBoxElement instead of the FillPrimitive Color:
this.radTextBox1.TextBoxElement.TextBoxItem.BackColor = Color.Green; |
The code below is equivalent to the one above:
((RadTextBoxItem)this.radTextBox2.TextBoxElement.GetChildrenByType(typeof(RadTextBoxItem))[0]).BackColor = Color.Green; |
3. Using custom themes made with Telerik Visual Style Builder. This is the most advanced way to customize the appearance of the controls. In the themes, you can create different property sets for different conditions (like IsMouseOver, IsFocused, etc.). In addition, the text can be set in a theme for advanced effects in different states. We decided to allow setting as many properties as possible by a theme in order to allow a greter degree of freedom. You could learn more about using the Visual Style Builder in our video section.
I hope this was helpful. If you have other questions do not hesitate to contact me again.
Greetings,
Martin Vasilev
the Telerik team