listbox_selectedIndexChanged event

  • Thread starter Thread starter Kilo Bravo
  • Start date Start date
K

Kilo Bravo

when does the listbox_selectedIndexChanged event fire? I can only get
something to happen when I clear the listbox. I want to get the value of the
item currently selected in the listbox but the dotnet version of listbox
does not seem to work like the old version of it.

Kilo Bravo
 
Kilo Bravo said:
when does the listbox_selectedIndexChanged event fire? I can only get
something to happen when I clear the listbox. I want to get the value of
the item currently selected in the listbox

\\\
Private Sub ListBox1_SelectedIndexChanged( _
ByVal sender As System.Object, _
ByVal e As System.EventArgs _
) Handles ListBox1.SelectedIndexChanged
Me.Label1.Text = DirectCast(Me.ListBox1.SelectedItem, String)
End Sub
///
 
Kilo,

In addition to the other posters.

Be aware that the selected index of this control change whenever you change
that. So when you are initializing the control or if you change the index
inside this event.

I hope this helps,

Cor
 

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