Solved

Calculate sum of currency textbox values II

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
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…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

707 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now