If the code throws exception on clicking on next button I can't handle it in the main method that starts the wizard.
If I have:
[STAThread]
static void Main()
{
try{
WizardSheet wizard = new WizardSheet();
wizard.Pages.Add(new WelcomePage());
wizard.Pages.Add(new MiddlePage());
wizard.Pages.Add(new CompletePage());
Application.Run(wizard);
}catch
{
//handle exception
}
}
and an exception is thrown on pressing next button the exception is not passed to the catch section. And as a result unhandled exception dialog is shown. It seems that there is some thread problem...
The wizard throws unhandled exception.