Can anyone help me on this?

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
 
N

Nicholas Paldino [.NET/C# MVP]

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?
 
P

Paul Loveless

I too have experienced this error before. Since I couldn't resolve it, I
resorted to using the old manifest file.

Paul
 
M

Morten Wennevik

Hi Peter,

Try setting

Application.DoEvents();

right after setting the visual style.
 
T

Tom Dacon

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
IPad Multiple Users 0
Windows 10 Do you use the Windows App Store? 7
(More info) EnableVisualStyles breaks my program! 3
Nasty Bug in EnableVisualStyles - Help! 5
Changing the start up form 11
HttpContext 4
Outlook Outlook search 0

Top