如何显示flash消息以询问从列表框中选择列表

时间:2014-04-24 02:18:48

标签: vb.net listbox messagebox

你们可以帮我查一下这段代码吗? 如果用户不从列表框中选择任何选项,我想尝试显示flash消息

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

1 个答案:

答案 0 :(得分:0)

您必须将ListBoxHVM.SelectedValue分配给code

 Code=ListBoxHVM.SelectedValue

编辑2

 If code = "" Then