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.
Unfortunately, activation email could not send to your email. Please try again.

XPTaskBarItem / Showdialog problem

Thread ID:

Created:

Updated:

Platform:

Replies:

11420 Mar 5,2004 05:16 AM Dec 27,2007 07:20 AM Windows Forms 18
loading
Tags: Tools
Marco de Vries
Asked On March 5, 2004 05:16 AM

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.

Administrator [Syncfusion]
Replied On March 5, 2004 08:01 AM

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.

Administrator [Syncfusion]
Replied On 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. thanks, - Reddy

Marco de Vries
Replied On March 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. > >thanks, >- Reddy

Marco de Vries
Replied On March 5, 2004 01:18 PM

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.

Marco de Vries
Replied On March 5, 2004 01:35 PM

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

Administrator [Syncfusion]
Replied On 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: [APPLICATION_DESCRIPTION]

Christian Pogea
Replied On May 4, 2004 07:42 AM

what ist the different between enablevisualstyles and manifestfile?

Administrator [Syncfusion]
Replied On May 4, 2004 09:26 AM

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.

Lori S. Pearsall
Replied On June 7, 2004 06:21 PM

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.

Administrator [Syncfusion]
Replied On June 8, 2004 12:24 PM

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.

Lori S. Pearsall
Replied On June 8, 2004 01:26 PM

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!

Administrator [Syncfusion]
Replied On June 10, 2004 08:12 PM

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.

Administrator [Syncfusion]
Replied On June 16, 2004 01:40 PM

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.

Administrator [Syncfusion]
Replied On June 16, 2004 02: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.

Lori S. Pearsall
Replied On June 24, 2004 12:22 PM

Are there any updates on this issue?

Administrator [Syncfusion]
Replied On June 24, 2004 01: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

Rohit Singh
Replied On December 14, 2007 12:03 PM

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


Administrator [Syncfusion]
Replied On December 27, 2007 07:20 AM

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



CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;