Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old January 27th, 2006, 04:57 AM
Registered User
Join Date: Jan 2006
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default This is driving me nuts...

Good day fellas, and ladies. I have quite a big problem on my hands, and I'm lost for a sollution. Can't find anything on the net to help me either... Perhaps somebody here could provide me with some assistance, I would appreciate it.

Alright, I'm getting the following error : An unhandled exception of type 'System.StackOverflowException' occurred in system.windows.forms.dll

I have a user control with a tab control on it. Each tab has a chart (TeeChart) on it. There is a total of 5 tabs. The whole application works perfectly, except for when I click on the final tab in runtime.
Then the error occurs. The code breaks in...
        static void Main()
            Application.Run(new Form1());

Form1 is simply a test environment for my user control.
I wish I could post code, but what code should I post? Considering that the exception occurs when I click on a tab. There are no events triggered when I click on a tab.

To give a little bit more information. I have a seperate class for each Chart (displayed on it's own tab.) Each chart inherits from an abstract chart class. Additionaly I have a Charts class which is a collection of all the charts, and does the initialising and so forth.
Each chart class listens to events on the user control, basically it detects text box changes and updates the charts accordingly. As I said though, the error occurs when clicking on the final tab, all other things happen smoothly.

Please tell me that somebody has an idea of why this is happening.
Thanks in advance.

Old January 27th, 2006, 06:35 AM
Friend of Wrox
Join Date: Jun 2003
Posts: 453
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via AIM to Ankur_Verma Send a message via MSN to Ankur_Verma

The exception most probably is being thrown by the user control code, which, in the
absence of any local exception handler, is getting promoted as an application level
exception. I believe the problem lies in the user control and that too in the code
that initialized the chart on the last tab. You must be assigning the fields of your
chart Objects some values based on which the chart is prepared. The fields of the
chart object on the last tab is being assigned a value that is either not in correct
format, is out of acceptable range or has some problem which makes it unacceptable as
a value for the felids of chart object on the last tab.

Try enclosing the initialization code of the last tab in try catch to see whats
The problem there or if the problem is indeed there.

Ankur Verma
Old January 27th, 2006, 07:13 AM
Registered User
Join Date: Jan 2006
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts

Thanks for the reply. I already have try{}catch{} blocks around relevant code.
The problem is that no code executes when the tab is clicked. I went a step further and attached an eventhandler to the tabcontrol's index change. It runs through this code fine. All that happens during this operation is that the tab index changes, and the TeeChart control is displayed. I can only think that the error is generated within the charts "draw" code. Over which I have no control offcourse. I will have to further pursue this problem with the creators of the chart it would seem. Thanks again for the advice.

Old January 27th, 2006, 06:51 PM
Authorized User
Join Date: Dec 2005
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to arielote Send a message via MSN to arielote Send a message via Yahoo to arielote

I've got similar error in other kind of application.
Please before draw anything to a graph check the data that the chart are going to receive.
Probably you are going to read a database, you have to be sure that the data gathered are valid and same kind that the chart are expecting.

I would show tables (grids??) to show me the information and to debug the application.
When I'll be sure about this, I would pass this info to chart objects.

Sorry if I missunderstood your problem, but I tried to help you


Ariel Folonier
San Nicolas

Similar Threads
Thread Thread Starter Forum Replies Last Post
Help! CommandButton Caption Driving Me Nuts! phoenixblue C# 0 September 29th, 2006 03:19 AM
Driving me nuts! bhd8ball Classic ASP Professional 2 January 7th, 2005 12:55 AM
This is driving me nuts!!! (datagrid in .ascx) dragonoodle General .NET 2 December 13th, 2004 03:48 PM
English Query Problem is Driving me Nuts... davidlars99 Classic ASP Professional 0 September 29th, 2004 01:29 PM
Type mismatch - Going Nuts ivanv ASP.NET 1.0 and 1.1 Basics 1 July 10th, 2003 03:15 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.