473,394 Members | 1,696 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,394 software developers and data experts.

baffled?

I am a complete newbie to .net.
I have just built a simple Stopwatch Application but when I F5 to get things going I get this message popping up.
An unhandled exception of type 'System.ArithmeticException' occurred in system.drawing.dll

Additional information: Overflow or underflow in the arithmetic operation.

I am totally stumped. I sent this to my tutor who advised this works on his machine??

Please help I'm desperate..

Nov 20 '05 #1
10 1088
We need to see your code.

"Damien" <li****@blueyonder.co.uk> wrote in message news:4b***************@news-binary.blueyonder.co.uk...
I am a complete newbie to .net.
I have just built a simple Stopwatch Application but when I F5 to get things going I get this message popping up.
An unhandled exception of type 'System.ArithmeticException' occurred in system.drawing.dll

Additional information: Overflow or underflow in the arithmetic operation.

I am totally stumped. I sent this to my tutor who advised this works on his machine??

Please help I'm desperate..
Nov 20 '05 #2
No one can help you unless you poost some code and describe the problem better.
--
Joe Fallon
"Damien" <li****@blueyonder.co.uk> wrote in message news:4b***************@news-binary.blueyonder.co.uk...
I am a complete newbie to .net.
I have just built a simple Stopwatch Application but when I F5 to get things going I get this message popping up.
An unhandled exception of type 'System.ArithmeticException' occurred in system.drawing.dll

Additional information: Overflow or underflow in the arithmetic operation.

I am totally stumped. I sent this to my tutor who advised this works on his machine??

Please help I'm desperate..
Nov 20 '05 #3
* "Damien" <li****@blueyonder.co.uk> scripsit:
I am a complete newbie to .net.

I have just built a simple Stopwatch Application but when I F5 to get things going I get this message popping up.

An unhandled exception of type 'System.ArithmeticException' occurred in system.drawing.dll

Additional information: Overflow or underflow in the arithmetic operation.

I am totally stumped. I sent this to my tutor who advised this works on his machine??


Help _impossible_ without more details. Where and when does this
exception occur?

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #4
Option Explicit On

Public Class frmStopWatch

Inherits System.Windows.Forms.Form

#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() call

End Sub

'Form overrides dispose to clean up the component list.

Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)

If disposing Then

If Not (components Is Nothing) Then

components.Dispose()

End If

End If

MyBase.Dispose(disposing)

End Sub

'Required by the Windows Form Designer

Private components As System.ComponentModel.IContainer

'NOTE: The following procedure is required by the Windows Form Designer

'It can be modified using the Windows Form Designer.

'Do not modify it using the code editor.

Friend WithEvents btnStart As System.Windows.Forms.Button

Friend WithEvents btnEnd As System.Windows.Forms.Button

Friend WithEvents btnExit As System.Windows.Forms.Button

Friend WithEvents Label1 As System.Windows.Forms.Label

Friend WithEvents Label2 As System.Windows.Forms.Label

Friend WithEvents Label3 As System.Windows.Forms.Label

Friend WithEvents lblStart As System.Windows.Forms.Label

Friend WithEvents lblEnd As System.Windows.Forms.Label

Friend WithEvents lblElapsed As System.Windows.Forms.Label

<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()

Me.btnStart = New System.Windows.Forms.Button()

Me.btnEnd = New System.Windows.Forms.Button()

Me.btnExit = New System.Windows.Forms.Button()

Me.Label1 = New System.Windows.Forms.Label()

Me.Label2 = New System.Windows.Forms.Label()

Me.Label3 = New System.Windows.Forms.Label()

Me.lblStart = New System.Windows.Forms.Label()

Me.lblEnd = New System.Windows.Forms.Label()

Me.lblElapsed = New System.Windows.Forms.Label()

Me.SuspendLayout()

'

'btnStart

'

Me.btnStart.Location = New System.Drawing.Point(16, 24)

Me.btnStart.Name = "btnStart"

Me.btnStart.TabIndex = 0

Me.btnStart.Text = "&Start Timing"

'

'btnEnd

'

Me.btnEnd.Location = New System.Drawing.Point(16, 112)

Me.btnEnd.Name = "btnEnd"

Me.btnEnd.TabIndex = 1

Me.btnEnd.Text = "&End Timing"

'

'btnExit

'

Me.btnExit.Location = New System.Drawing.Point(16, 208)

Me.btnExit.Name = "btnExit"

Me.btnExit.TabIndex = 2

Me.btnExit.Text = "E&xit"

'

'Label1

'

Me.Label1.Location = New System.Drawing.Point(152, 24)

Me.Label1.Name = "Label1"

Me.Label1.TabIndex = 3

Me.Label1.Text = "Start Time"

'

'Label2

'

Me.Label2.Location = New System.Drawing.Point(152, 112)

Me.Label2.Name = "Label2"

Me.Label2.TabIndex = 4

Me.Label2.Text = "End Time"

'

'Label3

'

Me.Label3.Location = New System.Drawing.Point(144, 208)

Me.Label3.Name = "Label3"

Me.Label3.TabIndex = 5

Me.Label3.Text = "Elapsed Time(sec)"

'

'lblStart

'

Me.lblStart.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D

Me.lblStart.Location = New System.Drawing.Point(304, 24)

Me.lblStart.Name = "lblStart"

Me.lblStart.TabIndex = 6

'

'lblEnd

'

Me.lblEnd.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D

Me.lblEnd.Location = New System.Drawing.Point(304, 112)

Me.lblEnd.Name = "lblEnd"

Me.lblEnd.TabIndex = 7

'

'lblElapsed

'

Me.lblElapsed.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D

Me.lblElapsed.Location = New System.Drawing.Point(304, 208)

Me.lblElapsed.Name = "lblElapsed"

Me.lblElapsed.TabIndex = 8

'

'frmStopWatch

'

Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)

Me.ClientSize = New System.Drawing.Size(456, 262)

Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.lblElapsed, Me.lblEnd, Me.lblStart, Me.Label3, Me.Label2, Me.Label1, Me.btnExit, Me.btnEnd, Me.btnStart})

Me.ForeColor = System.Drawing.Color.Black

Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle

Me.Name = "frmStopWatch"

Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScree n

Me.Text = "Stopwatch Application"

Me.ResumeLayout(False)

End Sub

#End Region

Dim StartTime As Date

Dim EndTime As Date

Dim ElapsedTime As Double

Private Sub btnStart_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnStart.Click

'Establish and print starting time

StartTime = Now

lblStart.Text = Format(StartTime, "hh:mm:ss")

lblEnd.Text = ""

lblElapsed.Text = ""

End Sub

Private Sub btnEnd_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnEnd.Click

'Find the ending time, compute the elapsed time

'Put both values in lable boxes

EndTime = Now

ElapsedTime = DateDiff(DateInterval.Second, StartTime, EndTime)

lblEnd.Text = Format(EndTime, "hh:mm:ss")

lblElapsed.Text = Format(ElapsedTime, "0")

End Sub

Private Sub btnExit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnExit.Click

Me.Close()

End Sub

End Class

"Joe Fallon" <jf******@nospamtwcny.rr.com> wrote in message news:u6**************@TK2MSFTNGP11.phx.gbl...
No one can help you unless you poost some code and describe the problem better.
--
Joe Fallon
"Damien" <li****@blueyonder.co.uk> wrote in message news:4b***************@news-binary.blueyonder.co.uk...
I am a complete newbie to .net.
I have just built a simple Stopwatch Application but when I F5 to get things going I get this message popping up.
An unhandled exception of type 'System.ArithmeticException' occurred in system.drawing.dll

Additional information: Overflow or underflow in the arithmetic operation.

I am totally stumped. I sent this to my tutor who advised this works on his machine??

Please help I'm desperate..

Nov 20 '05 #5
Option Explicit On

Public Class frmStopWatch
Inherits System.Windows.Forms.Form

#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() call

End Sub

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

'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer

'NOTE: The following procedure is required by the Windows Form
Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
Friend WithEvents btnStart As System.Windows.Forms.Button
Friend WithEvents btnEnd As System.Windows.Forms.Button
Friend WithEvents btnExit As System.Windows.Forms.Button
Friend WithEvents Label1 As System.Windows.Forms.Label
Friend WithEvents Label2 As System.Windows.Forms.Label
Friend WithEvents Label3 As System.Windows.Forms.Label
Friend WithEvents lblStart As System.Windows.Forms.Label
Friend WithEvents lblEnd As System.Windows.Forms.Label
Friend WithEvents lblElapsed As System.Windows.Forms.Label
<System.Diagnostics.DebuggerStepThrough()> Private Sub
InitializeComponent()
Me.btnStart = New System.Windows.Forms.Button()
Me.btnEnd = New System.Windows.Forms.Button()
Me.btnExit = New System.Windows.Forms.Button()
Me.Label1 = New System.Windows.Forms.Label()
Me.Label2 = New System.Windows.Forms.Label()
Me.Label3 = New System.Windows.Forms.Label()
Me.lblStart = New System.Windows.Forms.Label()
Me.lblEnd = New System.Windows.Forms.Label()
Me.lblElapsed = New System.Windows.Forms.Label()
Me.SuspendLayout()
'
'btnStart
'
Me.btnStart.Location = New System.Drawing.Point(16, 24)
Me.btnStart.Name = "btnStart"
Me.btnStart.TabIndex = 0
Me.btnStart.Text = "&Start Timing"
'
'btnEnd
'
Me.btnEnd.Location = New System.Drawing.Point(16, 112)
Me.btnEnd.Name = "btnEnd"
Me.btnEnd.TabIndex = 1
Me.btnEnd.Text = "&End Timing"
'
'btnExit
'
Me.btnExit.Location = New System.Drawing.Point(16, 208)
Me.btnExit.Name = "btnExit"
Me.btnExit.TabIndex = 2
Me.btnExit.Text = "E&xit"
'
'Label1
'
Me.Label1.Location = New System.Drawing.Point(152, 24)
Me.Label1.Name = "Label1"
Me.Label1.TabIndex = 3
Me.Label1.Text = "Start Time"
'
'Label2
'
Me.Label2.Location = New System.Drawing.Point(152, 112)
Me.Label2.Name = "Label2"
Me.Label2.TabIndex = 4
Me.Label2.Text = "End Time"
'
'Label3
'
Me.Label3.Location = New System.Drawing.Point(144, 208)
Me.Label3.Name = "Label3"
Me.Label3.TabIndex = 5
Me.Label3.Text = "Elapsed Time(sec)"
'
'lblStart
'
Me.lblStart.BorderStyle =
System.Windows.Forms.BorderStyle.Fixed3D
Me.lblStart.Location = New System.Drawing.Point(304, 24)
Me.lblStart.Name = "lblStart"
Me.lblStart.TabIndex = 6
'
'lblEnd
'
Me.lblEnd.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D
Me.lblEnd.Location = New System.Drawing.Point(304, 112)
Me.lblEnd.Name = "lblEnd"
Me.lblEnd.TabIndex = 7
'
'lblElapsed
'
Me.lblElapsed.BorderStyle =
System.Windows.Forms.BorderStyle.Fixed3D
Me.lblElapsed.Location = New System.Drawing.Point(304, 208)
Me.lblElapsed.Name = "lblElapsed"
Me.lblElapsed.TabIndex = 8
'
'frmStopWatch
'
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.ClientSize = New System.Drawing.Size(456, 262)
Me.Controls.AddRange(New System.Windows.Forms.Control()
{Me.lblElapsed, Me.lblEnd, Me.lblStart, Me.Label3, Me.Label2, Me.Label1,
Me.btnExit, Me.btnEnd, Me.btnStart})
Me.ForeColor = System.Drawing.Color.Black
Me.FormBorderStyle =
System.Windows.Forms.FormBorderStyle.FixedSingle
Me.Name = "frmStopWatch"
Me.StartPosition =
System.Windows.Forms.FormStartPosition.CenterScree n
Me.Text = "Stopwatch Application"
Me.ResumeLayout(False)

End Sub

#End Region

Dim StartTime As Date
Dim EndTime As Date
Dim ElapsedTime As Double

Private Sub btnStart_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles btnStart.Click
'Establish and print starting time
StartTime = Now
lblStart.Text = Format(StartTime, "hh:mm:ss")
lblEnd.Text = ""
lblElapsed.Text = ""
End Sub

Private Sub btnEnd_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles btnEnd.Click
'Find the ending time, compute the elapsed time
'Put both values in lable boxes
EndTime = Now
ElapsedTime = DateDiff(DateInterval.Second, StartTime, EndTime)
lblEnd.Text = Format(EndTime, "hh:mm:ss")
lblElapsed.Text = Format(ElapsedTime, "0")
End Sub

Private Sub btnExit_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles btnExit.Click
Me.Close()
End Sub
End Class
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 20 '05 #6
This occurs after I have built the application and I press F5 to try and get
it going.?
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:bq*************@ID-208219.news.uni-berlin.de...
* "Damien" <li****@blueyonder.co.uk> scripsit:
I am a complete newbie to .net.

I have just built a simple Stopwatch Application but when I F5 to get things going I get this message popping up.
An unhandled exception of type 'System.ArithmeticException' occurred in system.drawing.dll
Additional information: Overflow or underflow in the arithmetic operation.
I am totally stumped. I sent this to my tutor who advised this works on
his machine??
Help _impossible_ without more details. Where and when does this
exception occur?

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>

Nov 20 '05 #7
Cor
Hi Damien,

When I push F5 it goes normal.
VB.2003 with framework 1.1 what do you have?

Cor

Nov 20 '05 #8
* "Damien" <li****@blueyonder.co.uk> scripsit:
[...]

Seems to work on my Windows XP Professional + VS.NET 2003 machine...

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #9
* "Damien" <li****@blueyonder.co.uk> scripsit:
This occurs after I have built the application and I press F5 to try and get
it going.?


Maybe there is a problem in 'Sub InitializeComponent' when calculating
font sizes. Do you use non-standard fonts in your application? Which
Windows version do you use?

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #10
Font size is 8.25 and the version I am using is from Visual Studio.Net
version 2002
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:bq*************@ID-208219.news.uni-berlin.de...
* "Damien" <li****@blueyonder.co.uk> scripsit:
This occurs after I have built the application and I press F5 to try and get it going.?


Maybe there is a problem in 'Sub InitializeComponent' when calculating
font sizes. Do you use non-standard fonts in your application? Which
Windows version do you use?

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>

Nov 20 '05 #11

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

Similar topics

2
by: Lazareth S. Link | last post by:
Hiya to whoever might stumble across this. I've recently taken up learning how to script/program in python. I've made my first program, a simple fahrenheit-celsius converter, both ways. For...
4
by: Mark Thomas | last post by:
Hi I do not understand why the following does not compile under Visual C++ 7.1. It is just a simple "Hello, World" program. // Hello World Application. Why does this fail? #include <iostream>...
6
by: Doug Baroter | last post by:
Hi, Don't worry about the vars, they are defined, the following line give me an err of "Incorrect syntax near '.'." Goal: to rename nonstardard column name. EXEC sp_rename...
4
by: Steve K | last post by:
While I'm no css guru by any stretch, I thought I knew more than this, guess not. I'm trying to come up with a style for a few lines of text that are secondary to the text above them, so I want...
13
by: s_m_b | last post by:
I'm building a suite of online forms for insurance. These have been stripped down from messy MS Word templates, and two of the six, substantially identical, are misbehaving with the .js page that...
4
by: Tim Robinson | last post by:
Hi, I generally consider myself competent with the complexities of quoting but I can't figure out postgres at all. I've read the manual and it looks very straightforward but that doesn't accord...
17
by: sheldonlg | last post by:
I need to do some modifications on some code I just inherited and that code has me baffled. On one page, caller.php, with method get there is an anchor with href="foo.php?bar=123". On foo.php,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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...
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.