|
-
Apr 2nd, 2011, 02:01 PM
#1
Thread Starter
New Member
Having problems with a list box program...
I'm writing a list box program to calculate the Registration and Lodging for a person who does a certain workshop at a certain location and for some reason, it's working fine except when you click on "How to Interview" from the Workshop List Box.
When the total Lodging and Registration are calculated in the Costs List Box, Lodging comes out to 0 and Registration comes out to 0.
All the other workshops work fine with all 6 of their locations and the calculations are correct except for "How to Interview"
I'm new to list boxes and fear this might be some kind of logic error on my part.
Can someone who's 100x more VB savvy help me out on this one? 
Here's my code:
Private Sub btnWorkshop_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnWorkshop.Click
Dim intDays As Integer = 0
Dim intRegistration As Integer = 0
Dim intLodging As Integer = 0
If lstWorkshop.SelectedItem = "Handling Stress" Then
intDays = 3
intRegistration = 595
ElseIf lstWorkshop.SelectedItem = "Time Management" Then
intDays = 3
intRegistration = 695
ElseIf lstWorkshop.SelectedItem = "Supervision Skills" Then
intDays = 3
intRegistration = 995
ElseIf lstWorkshop.SelectedItem = "Negotiation" Then
intDays = 5
intRegistration = 1295
ElseIf lstWorkshop.SelectedItem = "How to Interview" Then
intDays = 1
intRegistration = 395
ElseIf lstWorkshop.SelectedItem Is Nothing Then
MessageBox.Show("Please Select a Workshop")
End If
If lstLocation.SelectedItem = "Austin" Then
intLodging = intDays * 95
ElseIf lstLocation.SelectedItem = "Chicago" Then
intLodging = intDays * 125
ElseIf lstLocation.SelectedItem = "Dallas" Then
intLodging = intDays * 110
ElseIf lstLocation.SelectedItem = "Orlando" Then
intLodging = intDays * 100
ElseIf lstLocation.SelectedItem = "Phoenix" Then
intLodging = intDays * 92
ElseIf lstLocation.SelectedItem = "Raleigh" Then
intLodging = intDays * 90
ElseIf lstLocation.SelectedItem Is Nothing Then
MessageBox.Show("Please Select a Location")
End If
lstCosts.Items.Add("Lodging: " & intLodging )
lstCosts.Items.Add("Registration: " & intRegistration)
End Sub
End Class
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
|