- 0
Calculation Problem
-
Recently Browsing 0 members
- No registered users viewing this page.
-
Similar Content
-
Save 97% off the Mastering Discrete & Financial Mathematics Bundle
By News Staff,
- financial mathematics
- mathematics
- (and 7 more)
- 0 replies
- 200 views
-
Toshiba's new algorithm seemingly leverages quantum computing while running on ordinary PCs
By Ather Fawaz,
- algorithm
- computation
- (and 11 more)
- 2 replies
- 615 views
-
- 0 replies
- 1,328 views
-
Question
Kaylee lee
I try to play
to select different checbox n then press the textbox quantity - for example i try to type 15 in the textbox quality but then the stock and total textbox turn zero.
Plus I'm beginner, I want to know what's wrong or something missing in this coding n let me know, i want to finish my homework as soon as possible before sunday.
how to select combobox delivery to add in total label?
'step 1 : variable Declaration
Dim Quantity As Single
Dim Stock As Single
Dim Qty2 As Single
Dim Stock2 As Single
Dim qty3 As Single
Dim Stock3 As Single
Dim Qty4 As Single
Dim stock4 As Single
'Dim Total As single
'Step 2 : Variable Expression
Try
Quantity = txtQty_Rose.Text
Stock = lblStock_Rose.Text
Qty2 = CType(txtQty_Lily.Text, Integer)
Stock2 = lblStock_Lily.Text
qty3 = CType(txtQty_Sunflower.Text, Integer)
Stock3 = lblStock_Sunflower.Text
Qty4 = CType(txtQty_Morning_Glory.Text, Integer)
stock4 = lblStock_Key.Text
'Total = lblTotal.Text
Catch ex As Exception
'step 3: output
If chkRose.Checked = True Then
lblStock_Rose.Text = Stock - Quantity
txtTotal_Rose.Text = Quantity * 10
End If
If chkLily.Checked = True Then
lblStock_Lily.Text = Stock2 - Qty2
txtTotal_Lily.Text = Qty2 * 20
End If
If chkSunflower.Checked = True Then
lblStock_Sunflower.Text = Stock3 - qty3
txtTotal_Sunflower.Text = qty3 * 12
End If
If chkMorning_Glory.Checked = True Then
lblStock_Key.Text = stock4 - Qty4
txtTotal_Glory.Text = Qty4 * 20
End If
End Try
lblTotal.Text = "Total :" & ("£") & txtTotal_Rose.Text + txtTotal_Lily.Text + txtTotal_Sunflower.Text + txtTotal_Glory.Text
Link to comment
https://www.neowin.net/forum/topic/1371100-calculation-problem/Share on other sites
2 answers to this question
Recommended Posts