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

Overriding message box theme when application theme is set

5 Answers 475 Views
Themes and Visual Style Builder
This is a migrated thread and some comments may be shown as answers.
Ruth Goldberg
Top achievements
Rank 1
Ruth Goldberg asked on 01 Feb 2010, 04:36 PM
Is it possible to have a theme for the whole application and a different theme be set with SetTheme for the RadMessageBox? If I set the application theme, SetTheme has no effect. I see how I can override specific controls in your documentation, but the MessageBox is not a form control and, as far as I can see, the only way to set its theme is with the SetTheme function. Can I change the ControlDefault theme to, for example, Breeze, so my forms will automatically use the theme I want for the whole application? If so, how do I go about doing it?

5 Answers, 1 is accepted

Sort by
0
Martin Vasilev
Telerik team
answered on 04 Feb 2010, 01:57 PM
Hello Ruth Goldberg,

Thank you for writing.

You can set a theme for the whole application by using ApplicationThemeName property of ThemeResolutionService object. Although there is a way to set different theme for some specified controls, this is not supported for RadMessageBox and currently it is not possible to set different theme for it in this scenario. More details on the topic you can find in the following help topic in our documentation.

Do not hesitate to contact me again if you have any other questions.

Greetings,
Martin Vasilev
the Telerik team

Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Follow the status of features or bugs in PITS and vote for them to affect their priority.
0
moftol
Top achievements
Rank 1
answered on 19 Mar 2013, 11:38 AM
is it to apply separate theme on RAD message box in the latest version of telerik controls or it is still not possible.
0
Anton
Telerik team
answered on 20 Mar 2013, 02:34 PM
Hi Farooq,

Thank you for writing.

The theme that is set through ApplicationThemeName property of ThemeResolutionService still is with higher priority and ignoring the SetThemeName method of the RadMessageBox. But you can use the ApplyThemeToControlTree method of ThemeResolutionService and apply the theme to the form. In this case the SetThemeName method will be not ignored but you should apply the main theme to all forms in your application.
For example:
DesertTheme theme2 = new DesertTheme();
TelerikMetroTheme theme3 = new TelerikMetroTheme();
Windows7Theme theme = new Windows7Theme();
 
private void Form1_Load(object sender, EventArgs e)
{
    ThemeResolutionService.ApplyThemeToControlTree(this, "Windows7");
}
 
private void button1_Click(object sender, EventArgs e)
{
    RadMessageBox.SetThemeName(theme2.ThemeName);
    RadMessageBox.Show("Text1", "Show", MessageBoxButtons.OK, RadMessageIcon.Error);
}
 
private void button2_Click(object sender, EventArgs e)
{
    RadMessageBox.SetThemeName(theme3.ThemeName);
    RadMessageBox.Show("Text2", "Show", MessageBoxButtons.OK, RadMessageIcon.Error);
}

Attached is the demo project that demonstrates the code above.

I hope this helps. Let me know if you have additional questions.

Greetings,
Anton
the Telerik team
WinForms Q1 2013 boasts PivotGrid, PDF Viewer, Chart enhancements and more. Check out all of the latest highlights.
0
JeffSM
Top achievements
Rank 2
Iron
Veteran
Iron
answered on 04 Feb 2020, 12:39 PM

Hello,

 

this is not working under .NET CORE 3.1 - Telerik Last version on 02/04/2020.

 

Best,

 

#jeffersonMotta #jeffTelerik

0
Dimitar
Telerik team
answered on 05 Feb 2020, 09:39 AM

Hello,

After converting the previously attached "Demo.zip" project to .Net Core 3.1, I have tested it against Telerik UI For Winforms R1 2020. (you can find the .NET Core project attached - "Test.zip").

In the project you can see that ApplyThemeToControlTree method applies a theme to the form which is different from the themes applied to the RadMessageBox. Since this is the expected behavior I am wondering If I am missing something? 

I am looking forward to your reply.

Regards,
Dimitar
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Themes and Visual Style Builder
Asked by
Ruth Goldberg
Top achievements
Rank 1
Answers by
Martin Vasilev
Telerik team
moftol
Top achievements
Rank 1
Anton
Telerik team
JeffSM
Top achievements
Rank 2
Iron
Veteran
Iron
Dimitar
Telerik team
Share this question
or