0

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
    }

1 Answer 1

1

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);
    }
2
  • As i mention in above comment,i had checked for theme name before asking question.
    – Anand
    Commented Oct 30, 2013 at 7:19
  • just change Application.Run(new Login()); with Login lg = new Login();Application.Run(lg); n it works,thanks
    – Anand
    Commented Oct 31, 2013 at 7:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.