Bug with modal dialogs in OnTextChanged (SEHException)

G

Gianluca

This one is a strange bug. The unhandled exception is generated only if
visual styles are enabled. It's very simple to reproduce, simply create a
windows application and add Application.EnableVisualStyles() in the Main
method. In the form put a combobox. Then create a second empty dialog form
Form2.

Hook up the comboBox1_TextChanged event and in there simpy add:

Form2 f = new Form2();
f.ShowDialog();

When you close the dialog the application will exit with a SEHException.
Comment out the Application.EnableVisualStyles() in Main and the exception
is gone.

/Gianluca
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top