ListBox Selection

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a list box that is populated with some file names from a directory. I cant seem to find how to tell what is selected. I wrote a message box to show me what was selected but it doesnt work.
 
* "=?Utf-8?B?Y2hyaXM=?= said:
I have a list box that is populated with some file names from a
directory. I cant seem to find how to tell what is selected. I wrote a
message box to show me what was selected but it doesnt work.

\\\
Private Sub ListBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListBox1.SelectedIndexChanged
If Me.ListBox1.SelectedIndex > -1 Then
MsgBox(CStr(Me.ListBox1.SelectedItem))
End If
End Sub
///
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top