We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

EnableVisualStyles

G''day, We enabled XP visual styles prior to calling Application.Run by calling Application.EnableVisualStyles and then Application.DoEvents (and then Application.Run). However we began to recieve this error - quite rarely at first, but now more and more: ''System.Runtime.InteropServices.SEHException'' It appeared to originate in the System.Windows.Forms dll. We then found this article from Microsoft at http://www.kbalertz.com/kb_897298.aspx: An unhandled exception of type ''System.Runtime.InteropServices.SEHException'' occurred in system.windows.forms.dll Note This issue occurs when the following conditions are true: • The event calls the Application.EnableVisualStyles method again. • The event calls the Application.EnableVisualStyles method when a form loads or after a form loads. Removing our initial call seemed to fix the problem. Since we only call EnableVisualStyles once, I was wondering if any Syncfusion code might call EnableVisualStyles. Cheers.

1 Reply

AD Administrator Syncfusion Team November 4, 2005 08:30 AM UTC

Hi Terry We use the manifest file to enable the visual styles, this would fix your problem. Regards Thomas >G''day, > >We enabled XP visual styles prior to calling Application.Run by calling Application.EnableVisualStyles and then Application.DoEvents (and then Application.Run). However we began to recieve this error - quite rarely at first, but now more and more: > >''System.Runtime.InteropServices.SEHException'' > >It appeared to originate in the System.Windows.Forms dll. We then found this article from Microsoft at http://www.kbalertz.com/kb_897298.aspx: > >An unhandled exception of type ''System.Runtime.InteropServices.SEHException'' occurred in system.windows.forms.dll >Note This issue occurs when the following conditions are true: >• The event calls the Application.EnableVisualStyles method again. >• The event calls the Application.EnableVisualStyles method when a form loads or after a form loads. > >Removing our initial call seemed to fix the problem. Since we only call EnableVisualStyles once, I was wondering if any Syncfusion code might call EnableVisualStyles. > >Cheers.

Loader.
Live Chat Icon For mobile
Up arrow icon