I'm stuck on a part of my assignment and wondering if someone could point me in the right direction.
Here's my problem, I have set my listBox button_up to disabled, but I need it to enable when there is at least 1 selected item in the listBox, here's my code for the remove button:
VB Code:
Private Sub btnRemove_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnRemove.Click If listBox.SelectedItems ' need selectedItem to = something??? Then Me.btnRemove.Enabled = True End If Dim item As String = listBox.SelectedItem Dim index As Integer = listBox.SelectedIndex listBox.Items.RemoveAt(index) listBox.Items.Insert(index - 1, item) listBox.SelectedIndex = index - 1 end sub
Thanks for any help.




Reply With Quote