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

XPTaskBarItem / Showdialog problem

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: ''System.Runtime.InteropServices.SEHException'' When I open the same form using a button I get no problem.

18 Replies

AD Administrator Syncfusion Team March 5, 2004 01:01 PM UTC

Hi Marco, I have created a sample application in v2.0.2.1 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. Regards, Guru Patwal Syncfusion, Inc.


AD Administrator Syncfusion Team March 5, 2004 01:16 PM UTC

I came across SEHException in my application in a different scenario. Are you using Application.EnableVisualStyles()? This was the culprit in my case. thanks, - Reddy


MD Marco de Vries March 5, 2004 06:14 PM UTC

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. > >thanks, >- Reddy


MD Marco de Vries March 5, 2004 06:18 PM UTC

Thanks. 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. >Hi Marco, > >I have created a sample application in v2.0.2.1 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. > >Regards, >Guru Patwal >Syncfusion, Inc.


MD Marco de Vries March 5, 2004 06:35 PM UTC

Dear All, As for now my problem has been solved using the Applications.Dovents method just after Application.EnableVisualStyles. VB Code: Public Sub Main Application.EnableVisualStyles Application.DoEvents Application.Run(new Form1) End Sub


AD Administrator Syncfusion Team March 5, 2004 07:18 PM UTC

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: [APPLICATION_DESCRIPTION]


CP Christian Pogea May 4, 2004 11:42 AM UTC

what ist the different between enablevisualstyles and manifestfile?


AD Administrator Syncfusion Team May 4, 2004 01:26 PM UTC

Hi Christian, 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. Regards, Guru Patwal Syncfusion, Inc.


LS Lori S. Pearsall June 7, 2004 10:21 PM UTC

Hi, 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.


AD Administrator Syncfusion Team June 8, 2004 04:24 PM UTC

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.


LS Lori S. Pearsall June 8, 2004 05:26 PM UTC

Hi Guru, 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. Thanks!


AD Administrator Syncfusion Team June 11, 2004 12:12 AM UTC

Hi Lori, 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. Regards, Guru Patwal Syncfusion, Inc.


AD Administrator Syncfusion Team June 16, 2004 05:40 PM UTC

I have to add that I am having the same problem as Marco and Lori. I am using Syncfusion 2.0.5.0 with .NET 1.1. I am writing in C#. I have the following calls to initialize XP themes: Application.EnableVisualStyles(); // 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! Application.DoEvents(); 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.


AD Administrator Syncfusion Team June 16, 2004 06:54 PM UTC

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.


LS Lori S. Pearsall June 24, 2004 04:22 PM UTC

Are there any updates on this issue?


AD Administrator Syncfusion Team June 24, 2004 05:48 PM UTC

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


RS Rohit Singh December 14, 2007 05:03 PM UTC

Hi all,

I get similar System.Runtime.InteropServices.SEHException in my C# Winforms application which uses Syncfusion 3.2.1.0
Even though we have not used EnableVisualStyles() in our application anywhere we get this error.

Please help.

regards,
Rohit



AD Administrator Syncfusion Team December 27, 2007 12:20 PM UTC

Hi Rohit,

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?

Regards,
Jaya



Loader.
Live Chat Icon For mobile
Up arrow icon