Dim FirstTime = True
Dim IndexChanged = True
Private Sub Form1_Load(ByVal sender As Object, _
ByVal e As System.EventArgs) Handles MyBase.Load
ComboBox1.DropDownStyle = ComboBoxStyle.DropDownList
ComboBox1.Items.Add("Apple")
ComboBox1.Items.Add("Banana")
ComboBox1.Items.Add("Cherry")
ComboBox1.Items.Add("Date")
ComboBox1.SelectedIndex = 0
Timer1.Enabled = True
End Sub
Private Sub ComboBox1_Enter(ByVal sender As Object, _
ByVal e As System.EventArgs) Handles ComboBox1.Enter
Timer1.Enabled = True
End Sub
Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As Object, _
ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
If Not FirstTime Then
IndexChanged = True
Else
FirstTime = False
End If
End Sub
Private Sub Timer1_Tick(ByVal sender As Object, _
ByVal e As System.EventArgs) Handles Timer1.Tick
If IndexChanged Then
Button1.Focus()
Timer1.Enabled = False
IndexChanged = False
End If
End Sub
Private Sub ComboBox1_MouseLeave(ByVal sender As Object, _
ByVal e As System.EventArgs) Handles ComboBox1.MouseLeave
Button1.Focus()
Timer1.Enabled = False
End Sub