Question

I have telerik messagebox,after loading startup form in my windows application messagebox.show() display popup in designer pattern but before that it popup with some dull theme. All i want to do is to show RadMessageBox.Show(this, "Body", "header", MessageBoxButtons.OK, RadMessageIcon.Info); in my Program.cs,where this should be iwindows32window type.Any help would be appreciated

static void Main()
    {//messagebox here displays with dull theme
  Application.Run(new Login());   
//messagebox here displays with original theme
    }
Was it helpful?

Solution

If I understand correctly, you are showing a message box prior setting your application theme, hence the message box does not have the correct theme. If so, you can use the following method, prior showing the text box, to set its theme:

RadMessageBox.SetThemeName("yourThemeNameHere");

EDIT: Here is what you can try:

  static void Main()
    {
        Application.EnableVisualStyles();
        Application.SetCompatibleTextRenderingDefault(false);

        Form f = new Form1(); //this contains some Telerik WinForms controls
        Telerik.WinControls.RadMessageBox.SetThemeName("TelerikMetro");
        Telerik.WinControls.RadMessageBox.Show("test");

        Application.Run(f);
    }
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top