|
-
Mar 24th, 2010, 08:16 AM
#1
Thread Starter
Lively Member
[RESOLVED] Program help... checkbox?
In my program, I can place an order for glasses.
To do this, I have 4 text boxes:
StockNumber: [12345]
GlassOrPlastic: [Glass/Plastic]
ScratchCoating: [Yes/No]
UVFilter: [Yes/No]
Currently, it works fine... BUT I need to type in Glass or Plastic, I need to type Yes/No and same for each thing, wondering would checkboxes be more effecient or how would I do it?
How do I even use checkboxes to get the same values...
(If I type in Glass it adds €30 to the price, if I type in Plastic only €15 is added...)
So if a Yes answer = €20 and a No = €10
How can I do that with checkboxes or whatever...
My code for when I click the order button, myAddNew just adds my information in..
ok Code:
Private Sub OrderButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OrderButton.Click
Dim myValue As Integer ' Base value of frames
Dim myValue1 As Integer ' Glass or plastic value
Dim myValue2 As Integer ' Scratch Coating value
Dim myValue3 As Integer ' UV value
Dim totalCost As Integer ' Total value
Dim deposit As Integer ' Deposit value, 20% of total
myValue = 50 'Base value of frames, always 50
Select Case GPTextBox.Text
Case "Glass"
myValue1 = 30
Case "Plastic"
myValue1 = 15
End Select
Select Case ScratchTextBox.Text
Case "Yes"
myValue2 = 10
Case "No"
myValue2 = 0
End Select
Select Case UVTextBox.Text
Case "Yes"
myValue3 = 15
Case "No"
myValue3 = 0
End Select
totalCost = myValue + myValue1 + myValue2 + myValue3 'Gets total by adding all values
deposit = totalCost * 0.2 'Divides total by 0.2 to find the 20% deposit
TextBox1.Text = totalCost 'Displays total
TextBox2.Text = deposit 'Displays deposit
TextBox3.Text = totalCost - deposit 'Subtracts the deposit from total, to find balance
PrintButton.Enabled = True
ViewButton.Enabled = True
myAddNew(8) 'CALLS ADDNEW METHOD WHEN ADD BUTTON IS CLICKED
End Sub
Last edited by Kielo; Mar 24th, 2010 at 08:24 AM.
Reason: code edit
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|