0

can u guys check this code for me? i want to try display flash message if the user dont select any options from the listbox

Public Sub btnHVM_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnHVM.Click

        ListBoxHVM.Visible = True
        Code =ListBoxHVM.SelectedValue 

        If Code = "" Then

            Dim Message As String = "Please make a selection"
            MessageBox.Show(Message)

        End If    
If Code = "B" Then

            ChooseB1(Station)
            ChooseB2(Station)

        End If

        If Code = "A" Then
            ChooseA1(Station)
            ChooseA2(Site)
            ChooseA3()
        End If

End Sub
zayya
  • 1
  • 3
  • the listbox `ListBoxHVM` is only visible when you click `btnHVM` then how can u select item ?? –  Apr 24 '14 at 05:02
  • ehm in my form, i dont have to click on btnHVM to make ListBoxHVM visible. isnt that visible means that it visible all the time??? – zayya Apr 24 '14 at 06:19

1 Answers1

0

You have to assign ListBoxHVM.SelectedValue to code

 Code=ListBoxHVM.SelectedValue

Edit 2

 If code = "" Then
Bender
  • 705
  • 11
  • 25