Click here to Skip to main content
15,929,025 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Simple SELECT statement not working Pin
Desert_Dude29-Nov-05 7:17
Desert_Dude29-Nov-05 7:17 
GeneralRe: Simple SELECT statement not working Pin
Scott Serl29-Nov-05 9:12
Scott Serl29-Nov-05 9:12 
GeneralRe: Simple SELECT statement not working Pin
Desert_Dude29-Nov-05 10:06
Desert_Dude29-Nov-05 10:06 
QuestionHow to give a version information in .NET ? Pin
binilsan28-Nov-05 14:52
binilsan28-Nov-05 14:52 
AnswerRe: How to give a version information in .NET ? Pin
Christian Graus28-Nov-05 15:30
protectorChristian Graus28-Nov-05 15:30 
GeneralRe: How to give a version information in .NET ? Pin
binilsan28-Nov-05 16:06
binilsan28-Nov-05 16:06 
Questioninstallation problem Pin
Tea152328-Nov-05 14:27
Tea152328-Nov-05 14:27 
QuestionCalculating check box values Pin
bob107028-Nov-05 13:52
bob107028-Nov-05 13:52 
I have to write this code which will calculate the cost of a pizza with toppings. I have created a drop down menu for the pizza size and it is working properly and will updated as a different size is selected.

The checkboxes are the problem. The checkboxes will update if I select them from right to left, but if I try to select them at random(ie...backwards), the values do not appear.

Anyone have any ideas as to what I am doing wrong?

Code is listed below:

Dim total1 As Decimal

Dim total2 As Decimal

Dim total3 As Decimal

Dim total4 As Decimal

Dim total5 As Decimal

Dim sizetotal As Decimal

Private Sub sizebox_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles sizebox.SelectedIndexChanged

sizebox.Items.IndexOf("Small")

sizebox.Items.IndexOf("Medium")

sizebox.Items.IndexOf("Large")

If sizebox.Text = "Small" Then

sizetotal = "7.00"

ElseIf sizebox.Text = "Medium" Then

sizetotal = "9.00"

ElseIf sizebox.Text = "Large" Then

sizetotal = "11.00"

End If

totallbl.Text = "Total is: " & sizetotal

If pepckbx.CheckState = CheckState.Checked Then

total1 = 0.5

Else : total1 = 0

End If

totallbl.Text = "Total is: " & sizetotal + total1

If mushckbx.CheckState = CheckState.Checked Then

total2 = 0.5

Else : total2 = 0

End If

totallbl.Text = "Total is: " & sizetotal + total1 + total2

If pineckbx.CheckState = CheckState.Checked Then

total3 = 0.5

Else : total3 = 0

End If

totallbl.Text = "Total is: " & sizetotal + total1 + total2 + total3

If onckbx.CheckState = CheckState.Checked Then

total4 = 0.5

Else : total4 = 0

End If

totallbl.Text = "Total is: " & sizetotal + total1 + total2 + total3 + total4

If pprckbx.Checked = True Then

total5 = 0.5

Else : total5 = 0

End If

totallbl.Text = "Total is: " & sizetotal + total1 + total2 + total3 + total4 + total5

End Sub

Private Sub pepckbx_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles pepckbx.CheckedChanged

If pepckbx.CheckState = CheckState.Checked Then

total1 = 0.5

Else : total1 = 0

End If

totallbl.Text = "Total is: " & sizetotal + total1

End Sub

Private Sub mushckbx_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mushckbx.CheckedChanged

If mushckbx.CheckState = CheckState.Checked Then

total2 = 0.5

Else : total2 = 0

End If

totallbl.Text = "Total is: " & sizetotal + total1 + total2

End Sub

Private Sub pineckbx_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles pineckbx.CheckedChanged

If pineckbx.CheckState = CheckState.Checked Then

total3 = 0.5

Else : total3 = 0

End If

totallbl.Text = "Total is: " & sizetotal + total1 + total2 + total3

End Sub

Private Sub onckbx_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles onckbx.CheckedChanged

If onckbx.CheckState = CheckState.Checked Then

total4 = 0.5

Else : total4 = 0

End If

totallbl.Text = "Total is: " & sizetotal + total1 + total2 + total3 + total4

End Sub

Private Sub pprckbx_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles pprckbx.CheckedChanged

If pprckbx.CheckState = CheckState.Checked Then

total5 = 0.5

Else : total5 = 0

End If

totallbl.Text = "Total is: " & sizetotal + total1 + total2 + total3 + total4 + total5

End Sub


AnswerRe: Calculating check box values Pin
Christian Graus28-Nov-05 15:33
protectorChristian Graus28-Nov-05 15:33 
AnswerRe: Calculating check box values Pin
Roy Heil29-Nov-05 7:30
professionalRoy Heil29-Nov-05 7:30 
QuestionScanning ? Pin
Lucktas28-Nov-05 9:19
Lucktas28-Nov-05 9:19 
AnswerRe: Scanning ? Pin
Ray Cassick28-Nov-05 11:44
Ray Cassick28-Nov-05 11:44 
GeneralRe: Scanning ? Pin
Lucktas28-Nov-05 20:47
Lucktas28-Nov-05 20:47 
QuestionHELP-VOice Recognition- Visual Basic Pin
jakabo28-Nov-05 8:47
jakabo28-Nov-05 8:47 
QuestionConnecting to DB using ini-file(HOW TO) Pin
djmd6028-Nov-05 7:57
djmd6028-Nov-05 7:57 
AnswerRe: Connecting to DB using ini-file(HOW TO) Pin
Vanting28-Nov-05 8:15
Vanting28-Nov-05 8:15 
GeneralRe: Connecting to DB using ini-file(HOW TO) Pin
djmd602-Dec-05 10:31
djmd602-Dec-05 10:31 
QuestionSaving an Image Pin
Anindya Chatterjee28-Nov-05 0:16
Anindya Chatterjee28-Nov-05 0:16 
AnswerRe: Saving an Image Pin
prathiba_naresh28-Nov-05 0:50
prathiba_naresh28-Nov-05 0:50 
Questiona dot matrix printer Pin
Greeky27-Nov-05 23:30
Greeky27-Nov-05 23:30 
AnswerRe: a dot matrix printer Pin
progload28-Nov-05 17:37
progload28-Nov-05 17:37 
GeneralRe: a dot matrix printer Pin
Greeky29-Nov-05 2:32
Greeky29-Nov-05 2:32 
QuestionColumn names in DataGrid Pin
liquid_27-Nov-05 11:04
liquid_27-Nov-05 11:04 
AnswerRe: Column names in DataGrid Pin
Briga27-Nov-05 23:01
Briga27-Nov-05 23:01 
QuestionNeed help with permissions for VB .NET applications Pin
xDanELx27-Nov-05 9:54
xDanELx27-Nov-05 9:54 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.