Overriding message box theme when application theme is set

4 posts, 0 answers
  1. Ruth Goldberg
    Ruth Goldberg avatar
    54 posts
    Member since:
    Dec 2009

    Posted 01 Feb 2010 Link to this post

    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?
  2. Martin Vasilev
    Martin Vasilev avatar
    1061 posts

    Posted 04 Feb 2010 Link to this post

    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.

    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.
  3. DevCraft R3 2016 release webinar banner
  4. moftol
    moftol avatar
    17 posts
    Member since:
    Feb 2008

    Posted 19 Mar 2013 Link to this post

    is it to apply separate theme on RAD message box in the latest version of telerik controls or it is still not possible.
  5. Anton
    Anton avatar
    167 posts

    Posted 20 Mar 2013 Link to this post

    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.Show("Text1", "Show", MessageBoxButtons.OK, RadMessageIcon.Error);
    private void button2_Click(object sender, EventArgs e)
        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.

    the Telerik team
    WinForms Q1 2013 boasts PivotGrid, PDF Viewer, Chart enhancements and more. Check out all of the latest highlights.
Back to Top