Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
Solved

# Calculate sum of currency textbox values II

Posted on 2006-06-25
Medium Priority
725 Views
HI Experts,

I need help on the code to calculate the sum of textbox values.

Sample of amounts entered in TextBoxes:
TextBoxA = \$7890.00
TextBoxB = \$7860.00
TextBoxC = \$10.00
TextBoxD = \$0.00

TextBoxE = Total of amounts

All TextBox Null values are \$0.00
Properties are set to Currency.

Windows Application
Visual Studio 2005
SQL Server 2005

0
Question by:dave_sky
[X]
###### Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

• Help others & share knowledge
• Earn cash & points

LVL 52

Accepted Solution

Carl Tawn earned 2000 total points
ID: 16979147

Try
Dim total As Double = 0.0
total += Double.Parse(TextBox1.Text.Substring(1))
total += Double.Parse(TextBox2.Text.Substring(1))
total += Double.Parse(TextBox3.Text.Substring(1))
total += Double.Parse(TextBox4.Text.Substring(1))
TextBox6.Text = total.ToString("C")
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
0

Author Comment

ID: 16979240
That was easy!

Many thanks.
0

## Featured Post

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
###### Suggested Courses
Course of the Month10 days, 3 hours left to enroll