I have two forms defined.
The first form has a XPTaskBar which has boxes with items. When I click an item I want to show a second form using the ShowDialog method.
It is opened successfully but when I close it I get the following Exception:
When I open the same form using a button I get no problem.
ADAdministrator Syncfusion Team March 5, 2004 08:01 AM
I have created a sample application in v220.127.116.11 as per your specifications and it seems to work fine here without any exceptions. Please refer to the sample and let me know if I have understood your requirements correctly. If not, modify the sample and send it back to us so that we can take a look at the problem. We appreciate your cooperation and thanks for choosing Syncfusion products.
ADAdministrator Syncfusion Team March 5, 2004 08:16 AM
I came across SEHException in my application in a different scenario. Are you using Application.EnableVisualStyles()? This was the culprit in my case.
MDMarco de VriesMarch 5, 2004 01:14 PM
Yes I use EnableVisualstyles.
I want my App to have a XP look,
rather then a dull Windows 3.10 one...
I will try without...
>I came across SEHException in my application in a different scenario. Are you using Application.EnableVisualStyles()? This was the culprit in my case.
MDMarco de VriesMarch 5, 2004 01:18 PM
Actually I use the 1.6.8 build and do everything in VB.NET rather than C.Net. I think the problems lies with Microsoft as I use Application.EnableVisualStyles, because I want my Textboxes and Buttons to have a XP look & feel as well.
>I have created a sample application in v18.104.22.168 as per your specifications and it seems to work fine here without any exceptions. Please refer to the sample and let me know if I have understood your requirements correctly. If not, modify the sample and send it back to us so that we can take a look at the problem. We appreciate your cooperation and thanks for choosing Syncfusion products.
MDMarco de VriesMarch 5, 2004 01:35 PM
As for now my problem has been solved using the
Applications.Dovents method just after Application.EnableVisualStyles.
Public Sub Main
ADAdministrator Syncfusion Team March 5, 2004 02:18 PM
We tried this Applications.Dovents method just after Application.EnableVisualStyles. It throws exception randomly on some machines even after adding this call.
If you want your application to work everywhere, it is better to use the manifest manifest file like:
CPChristian PogeaMay 4, 2004 06:42 AM
what ist the different between enablevisualstyles and manifestfile?
ADAdministrator Syncfusion Team May 4, 2004 08:26 AM
In order to draw the controls with visual styles, the .NET Windows Forms framework needs to delegate the drawing responsibility back to the common controls library. This is accomplished by setting a FlatStyle property on the controls and adding a manifest file. A manifest file is merely an XML file that contains run-time information about the application. Manifest file indicates that ComCtl32.dll version 6 should be used if it is available. Version 6 includes the support for changing the appearance of controls in a window, i.e., drawing with visual styles. It takes control at the application level. Therefore, you only need one manifest to affect the entire application including any dlls the application may use. The manifest file is required only in .Net framework v1.0.
EnableVisualStyles method is an inbuilt utility in .Net framework v1.1 that does the job of a .manifest file. Controls will draw with visual styles if the control and the operating system supports it. Please let me know if you need any other information.
LSLori S. PearsallJune 7, 2004 05:21 PM
I thought I''d jump in on this discussion as I''m having the same problems. Commenting out EnableVisualStyles worked for me.
So, now I use a manifest file. I followed all the steps in the Visual Studio .Net technical article entitled "Using Windows XP Visual Styles With Controls on Windows Forms" and it works. I do have one question - am I missing something or, in order to see Visual Styles, do I have to add the manifest to the executable file EVERY TIME I BUILD?? It seems so - no wonder everyone would prefer to use EnableVisualStyles.
ADAdministrator Syncfusion Team June 8, 2004 11:24 AM
Hi Lori, Like I mentioned earlier, the manifest file was required in .Net framework v1.0 to perform themed drawing of controls. If you are using v1.0, then you need to have the manifest file in the exe's folder every time you build your application. But v1.1 has inbuilt support for this feature and you could do so using the EnableVisualStyles method. Please refer to the following Windows Forms FAQ for information in this regard. How can I use XP Themes with Windows Forms using the .NET FrameWork 1.1? Let me know if you need additional information. Regards, Guru Patwal Syncfusion, Inc.
LSLori S. PearsallJune 8, 2004 12:26 PM
Yes, I was just adding to the conversation that EnableVisualStyles was causing the same exception error mentioned above in my project - I''m using .Net Framework v1.1.
ADAdministrator Syncfusion Team June 10, 2004 07:12 PM
Thanks for the update. We have not encountered any problems using the EnableVisualStyles in .Net framework 1.1 so far. In your case, it could be an usage issue or a genuine shortcoming in the .Net framework itself. Could you please send us a test sample that shows the problem that you are facing ? We appreciate your cooperation, and thanks for choosing Syncfusion products.
ADAdministrator Syncfusion Team June 16, 2004 12:40 PM
I have to add that I am having the same problem as Marco and Lori. I am using Syncfusion 22.214.171.124 with .NET 1.1. I am writing in C#.
I have the following calls to initialize XP themes:
// The following article "Applying Windows XP Visual Styles to Windows Forms Applications" tells me we have to do this
// if any Form contains an ImageList!
Note the inclusion of the DoEvents() call. I found this was ABSOLUTELY NECESSARY if any of my Forms contained ImageLists! Without it, my images were often not rendered. Bizarre.
My crash happens in the same circumstance as Marco''s. In my case I have a ParentBarItem acting as a pull-right menu. In my Click event handler, if I invoke a modal dialog using ShowDialog(), then Cancel it immediately, the SEHException is thrown and the app crashes. This is happening well after the Click handler returns. If I invoke this same dialog via a context menu, I do not get this problem. The problem goes away if I comment out the 2 lines of code above, but, of course, you lose XP themes.
I will attempt to create a smaller test project to repro this, but it is very repeatable.
ADAdministrator Syncfusion Team June 16, 2004 01:54 PM
I was able to create a test project that repros this problem quite cleanly (and repeatedly). I created a DirecTrac incident number 11882 for it. You can search for SEHException in the Description and you should find it. If you want, I hope you can get at the ZIP file as well. It is a simple C# project.
LSLori S. PearsallJune 24, 2004 11:22 AM
Are there any updates on this issue?
ADAdministrator Syncfusion Team June 24, 2004 12:48 PM
Hi Lori, It seems be due to EnabledVisualStyles and DoEvents and if you look in the Microsoft Newsgroups there have been a lot of issues reported on this subject and you will encounter problems without using Syncfusion controls. The only option to get rid of this problem is that you do not use the EnabledVisualStyles way of turning on themes and instead stick to the 1.0 way of turning themes on using manifest files. Here is a FAQ in George Shepherd's Windows Forms FAQ which show how you can enable XP Themes using a manifest file. Regards, Arun
RSRohit SinghDecember 14, 2007 12:03 PM
I get similar System.Runtime.InteropServices.SEHException in my C# Winforms application which uses Syncfusion 126.96.36.199 Even though we have not used EnableVisualStyles() in our application anywhere we get this error.
ADAdministrator Syncfusion Team December 27, 2007 07:20 AM
Thank you for your interest in Syncfusion products.
Could you please send me a sample illustrating the issue which would help me to track the issue and provide you a solution?