propagandhi
Member
- Joined
- Feb 20, 2005
- Messages
- 18
- Programming Experience
- Beginner
First of all, thanks for your time. My problem is that when i load my form, i need to have the focus set to a string in one of my list box's.
ListBox1.Select()
ListBox1.Focus()
ListBox1.SelectedIndex = 3
Dim strName as String 'String that needs to be found
Dim intCounter as Integer
Dim intRecordNumber as Integer = -1
For intCounter = 0 To lstNames.Items.Count - 1
lstNames.SelectedIndex = intCounter
If lstNames.Text = strName Then intRecordNumber = intCounter
Next intCounter
lstNames.SelectedIndex = -1
lstNames.SelectedIndex = intRecordNumber