Option Explicit On
Option Strict Off
Option Infer Off
Public Class MainForm
Private Sub MainForm_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
shippingoneListBox.Items.Add("60611")
shippingoneListBox.Items.Add("60234")
shippingoneListBox.Items.Add("56789")
shippingoneListBox.Items.Add("23467")
shippingoneListBox.Items.Add("60543")
shippingoneListBox.Items.Add("60561")
shippingoneListBox.Items.Add("55905")
shippingoneListBox.Items.Add("89567")
shippingtwoListBox.Items.Add("50978")
shippingtwoListBox.Items.Add("78432")
shippingtwoListBox.Items.Add("98432")
shippingtwoListBox.Items.Add("97654")
shippingtwoListBox.Items.Add("20245")
End Sub
Private Sub exitButton_Click(sender As Object, e As System.EventArgs) Handles exitButton.Click
Me.Close()
End Sub
Private Sub displayshipButton_Click(sender As Object, e As System.EventArgs) Handles displayshipButton.Click
Dim id As String = String.Empty
If (shippingoneListBox.FindString(zipTextBox.Text >= 0)) Then
shippingLabel.Text = "Shipping is $15"
shippingLabel.Show()
ElseIf (shippingtwoListBox.FindString(zipTextBox.Text >= 0)) Then
shippingLabel.Text = "Shipping is $20"
shippingLabel.Show()
Else
shippingLabel.Text = "The zipcode was not found!"
shippingLabel.Show()
End If
End Sub
End Class
When entering a zip code that is listed in "shippingtwoListBox" it will still tell me the shipping cost should be $15 when in fact it should be $20. Do I have something coded wrong that it isn't searching the second list box? Also, when I enter a zip code that isn't added to the listboxes the label isn't displaying "The zipcode was not found!"
Any help would be much appreciated!