Can anyone help me on this?

  • Thread starter Thread starter pnp
  • Start date Start date
P

pnp

Hi all,

I'm developing an app in C# and i'm using the
Application.EnableVisualStyles function before I call the
Applicaton.Run(...) function. The problem is that when I use a custom form
with ShowDialog to open in my app I get a
System.Runtime.InteropServices.SEHException... When I don't use
EnableVisualStyles in my app that exception doesn't occur.

Can anyone help me on this?

Thanks in advance,
Peter
 
Peter,

Are you calling ShowDialog inside of a message loop, or outside of the
message loop?

Can you show the code where ShowDialog is being called?
 
I too have experienced this error before. Since I couldn't resolve it, I
resorted to using the old manifest file.

Paul
 
Hi Peter,

Try setting

Application.DoEvents();

right after setting the visual style.
 
This is beginning to become a well-known problem with EnableVisualStyles.
The only solution seems to be to remove the EnableVisualStyles call and do
XP styles the 'old-fashioned way' with a manifest.

EnableVisualStyles has other problems as well. I hope that MS does some work
on that feature in a service pack or in the next release of the framework.

Tom Dacon
Dacon Software Consulting
 

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

Similar Threads

SEHException? 1
Windows 10 Do you use the Windows App Store? 7
IPad Multiple Users 0
(More info) EnableVisualStyles breaks my program! 3
Downgrading from Windows 11 1
Outlook Outlook search 0
Why does my dialog box create an Exception? 1
HttpContext 4

Back
Top