0

I need to make one statement to select either of the items in listbox and show the same label, regardless of which item is selected. I've tried someting like

 If Me.ListBox1.SelectedItem = "R115" Or "Bay, Charles" Then
                Label1.Text = "Address Information Avaliable"
            End If

But it doesn't work. The code below works but I need to make it shorter.

If Me.ListBox1.SelectedItem = "R115" Or Me.ListBox1.SelectedItem = "Bay, Charles" Then
            Label1.Text = "Address Information Avaliable"
        End If

Any suggestions?

2
Contributors
2
Replies
12
Views
3 Years
Discussion Span
Last Post by Start4me
0

I was just wondering if there's other ways to code this, make it short in coding to make it less lines of code. But I guess if there isn't, I'll do it the way I have it right now.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.