Font/color change at runtime

0
0

Hi guys,

Aah, these users again … they think that the Classic-2 theme font is too small and not black enough. I found out that I can go in the theme builder and change the font sizes in the “Fonts” section and also change the windowText color, in the Colors section, from #3F3F3F to #000000. However,

  1. Can I change these very fundamental values in a mixin? Will the definitions in the mixin file override those in the default theme? Or there is no point doing it and it is better changing them directly in the theme?
  2. Can I make such changes at runtime, at the click of a button? Like (+) for increasing the font size and (-) for decreasing it? I know that I can change theme at runtime but what about a single value like the font size?

Best,
Alex

  • You must to post comments
0
0

Hi Alex,

Yes you can change the basic fonts, colors and images in a mixin. Fonts have to be defined as a font. You can’t just change the size. However, you can set the font-size css property as a CSS property.

You can also create new fonts and use them by name, like “LargeFont”, “PanelTitle”, etc.

In the designer or in code you can refer to theme fonts using the name with the @ prefix. And you can clone a font and change the styles and/or size using the standard System.Drawing.Font class.

The designer will also let you reuse a font and simply change the size or style, the editor will create the new font statement for you.

HTH

Best,

Luca

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.