Hi,
I need to change my application's font dynamically,when I set the font of main window without setting theme everything works fine
but unfortunately when I set the theme changing font not working.
Is there any way to change the font of controls dynamically after setting theme?
3 Answers, 1 is accepted
0
Boryana
Telerik team
answered on 28 May 2012, 11:40 AM
Hi reza,
Thank you for writing.
Our themes apply font repositories to the RootElements of RadControls. For this reason, if you would like to change the font dynamically, you will need to iterate the controls and assign them the appropriate font. For example, to change the font of a RadForm with a RadButton on it use the following code:
Font f = new Font(new FontFamily("Segoe UI"), 9f);
this.Font = f;
this.radButton1.Font = f;
I hope this helps. Let me know if you encounter further issues.
I was unable to reproduce your problem. Please find attached a sample project and a screenshot of an applied TelerikMetro theme and modified from code font of the present controls.
If you still experience problems on setting the fonts dynamically please give us more details of your particular case.
I hope this information is useful. Should you have further questions please do not hesitate to write back.
Regards,
Hristo
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.