Solved

Calculate sum of currency textbox values II

Posted on 2006-06-25
2
712 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 500 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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 …
1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

792 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