Customizing RadMessageBox with custom theme
Product Version | Product | Author | Last modified |
---|---|---|---|
Q1 2009 | RadControls for WinForms | Martin Vassilev | Feb, 11, 2009 |
HOW-TO
Add a custom theme for RadMessageBox dialog.
SOLUTION
Considering the fact that RadMessageBox is build on RadControl elements, the process of creating a theme is the same as it is for every Telerik control. The easiest way to make and apply a theme is:
- Make separate theme files, using Visual Style Builder, for RadForm, RadButton and RadLabel. Please note that these themes should have the same ThemeName, for example "CustomMessageBox".
- Import these files in the application with RadThemeManager and apply them to RadMessageBox:
RadMessageBox.SetThemeName("CustomMessageBox");
RadMessageBox.Show(this, "Are you sure?", "Example Message", MessageBoxButtons.YesNo, icon);
RadMessageBox.SetThemeName("CustomMessageBox")
RadMessageBox.Show(Me, "Are you sure?", "Example Message", MessageBoxButtons.YesNo, icon)
Please, find an example solution here.