Overriding message box theme when application theme is set

6 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. 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.
  4. 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.
  5. JeffSM
    JeffSM avatar
    49 posts
    Member since:
    May 2014

    Posted 04 Feb 2020 in reply to Anton Link to this post



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




    #jeffersonMotta #jeffTelerik

  6. Dimitar
    Dimitar avatar
    25 posts

    Posted 05 Feb 2020 Link to this post


    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.

    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.
Back to Top