KAMPATEL1973
Member
- Joined
- Oct 7, 2015
- Messages
- 11
- Programming Experience
- Beginner
Hi Guys,
I have some code as follows for a listbox that is in a windows form with an OK button:
What I am finding is that the item gets selected as I require, but the OK button on the form gets focus, ideally I would like the list box to retain focus even though I have selected an index for it to select.
Is there a way to do this?
Everything works ok, its just the focus part that's not working.
Any help appreciated...
I have some code as follows for a listbox that is in a windows form with an OK button:
What I am finding is that the item gets selected as I require, but the OK button on the form gets focus, ideally I would like the list box to retain focus even though I have selected an index for it to select.
Is there a way to do this?
VB.NET:
Dim source() As String = Split(xml, ",")
Dim i As Integer
For i = 0 To UBound(source)
DialogBoxListBox.SelectList2.Items.Add(source(i))
Next
DialogBoxListBox.SelectList2.SelectedIndex = 0
Everything works ok, its just the focus part that's not working.
Any help appreciated...