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

Several classes on the same theme for the same control type

1 Answer 25 Views
Themes and Visual Style Builder
This is a migrated thread and some comments may be shown as answers.
Jorge Delgado-Lopez
Top achievements
Rank 1
Jorge Delgado-Lopez asked on 01 Jul 2008, 05:40 PM
Hi,

I need to create several classes for RadLabel on ONE theme. My problem is that I cannot set the size of the Font without setting the Font Family, which means that the Font set by the theme is overwritten. ("Headers" are bigger than "text").

Is it possible to have different classes on one theme? 

Thanks,
- jorge

1 Answer, 1 is accepted

Sort by
0
Mike
Telerik team
answered on 04 Jul 2008, 08:40 AM
Hello Jorge,

I hope I got your request correct. It is possible to set different styles for UI elements that have different "class" names - i.e. different Class property values. But the approach requires the usage of some of the more advanced settings of VSB and control designers. That's why I would suggest you an easier way to achieve what you need.

You can set the new font setting using just a few lines of code, without changing the Font family in the following way:

TextPrimitive textUI = (TextPrimitive)this.radLabel1.LabelElement.Children[2]; 
textUI.Font = new Font(textUI.Font.FontFamily, 12f); 

I assume that your label is called radLabel1 and that the theme applies the font settings directly on the TextPrimitive element of the label.

I'm sending you a sample application that demonstrates the approach.

Kind regards,
Mike
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Themes and Visual Style Builder
Asked by
Jorge Delgado-Lopez
Top achievements
Rank 1
Answers by
Mike
Telerik team
Share this question
or