Assign Custom Theme to RadMessageBox

3 posts, 0 answers
  1. Joseph
    Joseph avatar
    5 posts
    Member since:
    Mar 2013

    Posted 08 Aug 2016 Link to this post

    I am working on a WinForms app using Telerik 2016 Q2. It contains several themes created with Visual Style Builder that are managed by a radThemeManager control accessing the XML files directly (not as a resource). The Visual Studio 2015 solution also contains a couple of Telerik-created themes (visualStudio2012LightTheme1 & office2013LightTheme1).

    I would like to assign one of my custom themes to a radMessageBox control. Whatever I try, no theme is assigned. I first tried:

    RadMessageBox.Show(this, "messagebox text", "titleg", MessageBoxButtons.OK, RadMessageIcon.Info);

    The I tried putting this in the load event of the form:

    ThemeResolutionService.ApplicationThemeName = "customTheme";

    Neither worked. I then tried:

    RadMessageBox.SetThemeName("visualStudio2012LightTheme1"); //Telerik-supplied theme

    This partially worked as expected. It did override the custom themes of my controls throughout the form, but the radMessageBox still did not receive the theme (it was still set to the default theme).

    How can I apply a custom theme to a radMessageBox?


  2. Joseph
    Joseph avatar
    5 posts
    Member since:
    Mar 2013

    Posted 08 Aug 2016 Link to this post

    Figured this out and am posting the solution here just in case this weirdness affects anyone in the future.

    About five days before this issue arose I had a catastrophic failure of my Visual Studio 2015 solution. Completely corrupted. Would not open. So I generated a clone from my last good commit on GitHub and continued working on my code.

    This evening I attempted to add a radAboutBox to my WinForms project. I got this message:

    Your project uses GAC referenced assemblies. Please upgrade your project.

    When I attempted to use the Telerik Upgrade Wizard, I got this error message:

    An error occurred while running the wizard.
    Error executing custom action Telerik.WinControls.VSX.Actions.MultiProjectUpdateReferencesAction: System.IO.FileNotFoundException: Could not load file or assembly 'Telerik.WinControls.dll' or one of its dependencies.

    Sure enough, my \lib\RCWF\2016.2.608.40 subdirectory (which contains the XML and DLL files for the WinForms Telerik controls) was missing about 50 files (the GitHub clone only restored a subset omitting very important ones including Telerik.WinControls.dll). I restored the missing files from a local backup and my radMessageBox displayed with a custom theme as expected via this code:

    RadMessageBox.Show(this, "messagebox text", "title", MessageBoxButtons.OK, RadMessageIcon.Info);


  3. Hristo
    Hristo avatar
    1504 posts

    Posted 09 Aug 2016 Link to this post

    Hi Joseph,

    Thank you for writing.

    I am glad that you have managed to resolve the issue.

    Please let me know if you need further assistance.

    Hristo Merdjanov
    Telerik by Progress
    Check out the Windows Forms project converter, which aids the conversion process from standard Windows Forms applications written in C# or VB to Telerik UI for WinForms. For more information check out this blog post and share your thoughts.
Back to Top