Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Calculate sum of currency textbox values II

Posted on 2006-06-25
2
Medium Priority
?
730 Views
Last Modified: 2012-06-27
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
Comment
Question by:dave_sky
2 Comments
 
LVL 52

Accepted Solution

by:
Carl Tawn earned 2000 total points
ID: 16979147
How about something like:

        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

by:dave_sky
ID: 16979240
That was easy!

Many thanks.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Screencast - Getting to Know the Pipeline
Suggested Courses

783 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question