' hi i'm having problem with calculating the total it givs me zero , can any one help me please thanks .
Private Sub Button12_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button12.Click
Dim advanced As Double
Dim benefit As Double
Dim basic As Double
Dim hra As Double
Dim med_all As Double
Dim child As Double
Dim hma As Double
Dim total As Double
advanced = Convert.ToDouble(TextBox6.Text)
benefit = Convert.ToDouble(TextBox7.Text)
basic = Convert.ToDouble(TextBox8.Text)
hra = Convert.ToDouble(TextBox9.Text)
med_all = Convert.ToDouble(TextBox10.Text)
child = Convert.ToDouble(TextBox11.Text)
hma = Convert.ToDouble(TextBox12.Text)
total = Convert.ToDouble(TextBox13.Text)
TextBox6.Text = advanced.ToString
TextBox7.Text = benefit.ToString
TextBox8.Text = basic.ToString
TextBox9.Text = hra.ToString
TextBox10.Text = med_all.ToString
TextBox11.Text = child.ToString
TextBox12.Text = hma.ToString
TextBox13.Text = total.ToString
hra = hra * 5 / 100 * 100
med_all = med_all * 5 / 100 * 100
child = child * 5 / 100 * 100
hma = hma * 8 / 100 * 100
total = basic + advanced + benefit + hra + med_all + child + hma
End Sub
v
Sushta GuthnarPosted Jun 26, 2012, 2:53 PM
Mayur DighePosted Jun 18, 2012, 12:06 PM
You can do it.........dear,
but you know---- You are doing three things as follows.
(correct) Part 1. storing input values into Variables (String to Double)
(wrong) Part 2. And then .....AGAIN display those values to
SAME Textboxes (Double to String -- Exactly reversed to 1)
(correct) Part 3. Finally you stored the RESULT value into Variable (total)
Now.... make following CORRECTION (it might works )
firstly removed part-2 from CODE and then...... Display the total Variable into NEW Textbox...........
happy Programming.......