473,383 Members | 1,866 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

system Arithmetic Exception Error.

Hi, I have a pc with windows XP SP1, net Framworks 1.1 and visual studio net 2003

When I first installed Visual Studio 2003, I noticed I was getting th
follow error when showing a form

A first chance exception of type 'System.ArithmeticException' occurred i
system.drawing.dl
Additional information: Overflow or underflow in the arithmetic operatio

It is being thrown on the line that attempts to add the controls to th
form's controls collection (in the windows forms designer generated cod
region)

email mf*@tham.cl
Nov 20 '05 #1
3 1705
* "=?Utf-8?B?bWZjMjAwNA==?=" <an*******@discussions.microsoft.com> scripsit:
Hi, I have a pc with windows XP SP1, net Framworks 1.1 and visual studio net 2003.
When I first installed Visual Studio 2003, I noticed I was getting the
follow error when showing a form:

A first chance exception of type 'System.ArithmeticException' occurred in
system.drawing.dll
Additional information: Overflow or underflow in the arithmetic operation

It is being thrown on the line that attempts to add the controls to the
form's controls collection (in the windows forms designer generated code
region).


Can you post the form's complete code?

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #2
Hi

I've been getting the very same error on the very same operating system configuration, so here's my code. This was generated by adding a windows form with all default properties (including the name even) and then adding a label control with all default properties. If I run the form WITHOUT a control, it works. But as soon as I add ANY control, it gets a System.ArithmeticException error in System.Drawing. I've marked the line of code where it errors out with an asterisk

Public Class Form
Inherits System.Windows.Forms.For

#Region " Windows Form Designer generated code

Public Sub New(
MyBase.New(

'This call is required by the Windows Form Designer
InitializeComponent(

'Add any initialization after the InitializeComponent() cal

End Su

'Form overrides dispose to clean up the component list
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean
If disposing The
If Not (components Is Nothing) The
components.Dispose(
End I
End I
MyBase.Dispose(disposing
End Su

'Required by the Windows Form Designe
Private components As System.ComponentModel.IContaine

'NOTE: The following procedure is required by the Windows Form Designe
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor
Friend WithEvents Label1 As System.Windows.Forms.Labe
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent(
Me.Label1 = New System.Windows.Forms.Labe
Me.SuspendLayout(

'Label

Me.Label1.Location = New System.Drawing.Point(0, 0
Me.Label1.Name = "Label1
Me.Label1.TabIndex =
Me.Label1.Text = "Label1

'Form

Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13
Me.ClientSize = New System.Drawing.Size(292, 266
* Me.Controls.Add(Me.Label1
Me.Name = "Form1
Me.Text = "Form1
Me.ResumeLayout(False

End Su

#End Regio

End Clas

Nov 20 '05 #3
Hi Eric

In a new project or in an existing project?

Cor
Nov 20 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Gary.Hu | last post by:
I was trying to catch the Arithmetic exception, unsuccessfully. try{ int a = 0, b = 9; b = b / a; }catch(...){ cout << "arithmetic exception was catched!" << endl; } After ran the program,...
0
by: Fiona McBride | last post by:
Hi all, I have a really odd problem with some Visual Basic .NET 2003 code; I have a program that creates a number of windows which contain RichTextBox, Timers (disabled) and menus. The code...
4
by: tarmat | last post by:
I have a class that has a std::list of ints as a member. Let's say its this: std::list<int> MyInts; Frequently, another list of ints is assigned to MyInts MyInts = MyOtherInts; This...
4
by: Saso Zagoranski | last post by:
Hi! I have created an SqlCommand object and I have set some parameters to it... One of the parameters is of the DateTime type; here is the code: sqlCommand.Parameters.Value =...
9
by: Ron | last post by:
my application is throwing an exception error when closing if I run a procedure in the app. I can't even trap the error with try/catch ex As Exception. Is there a way to completely shut down the...
0
by: Matt | last post by:
Hello, I am trying to make an asp.net page and I keep getting the following error in my web browser: Error: External component has thrown an exception. Stack: at...
2
by: shivp | last post by:
Hi, I'm getting folowing exception error while compiling the code in VS2005. $exception {Unable to evaluate expression because the code is optimized or a native frame is on top of the call...
4
by: yogarajan | last post by:
hi i had developed pop3 Account mail view in my web page but i got error in (System.NullReference Exception: Object reference not set) NetStrm.Write(szData, 0, szData.Length); - this line ...
3
by: sriram347 | last post by:
Hi I am a newbie to ASP.NET. I developed a web page (project type is web application) and I keep getting this error. B]Error message : "System.AccessViolation Exception attempted to read or...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.