I have a listbox that contains numbers that vary from 0 to 99. My problem is when the number in the listbox is 0, listbox1.selectedindex will not return a value. So I cannot use removeat(x) which works for all other numbers. Can anyone give me an idea on how to do it ?
Gé48
1
Newbie Poster
Recommended Answers
Jump to PostPost your code. When I used the following code it worked fine.
Private Sub ListBox1_SelectedIndexChanged(sender As System.Object, e As System.EventArgs) Handles ListBox1.SelectedIndexChanged TextBox1.Text = ListBox1.SelectedIndex End Sub
All 4 Replies
Reverend Jim
4,780
Hi, I'm Jim, one of DaniWeb's moderators.
Moderator
Featured Poster
Gé48
1
Newbie Poster
Gé48
1
Newbie Poster
Reverend Jim
4,780
Hi, I'm Jim, one of DaniWeb's moderators.
Moderator
Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.