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
 
Back
Top