Home > Software engineering >  VB datalist control to be the focus how to automatically select the first line?
VB datalist control to be the focus how to automatically select the first line?

Time:10-06

Such as:
Private Sub Text1_KeyPress (KeyAscii As Integer)
If KeyAscii=13 Then
DataList1. SetFocus
End the If
End Sub
Private Sub DataList1_GotFocus ()
'asked: how to automatically select the first line of text (blue color)
End Sub

CodePudding user response:

 Datalist1. Listindex=0 

CodePudding user response:

Private Sub Text1_KeyPress (KeyAscii As Integer)
If KeyAscii=13 Then
DataList1. SetFocus
Sendkeys {" down "}
End If
  • Related