- Home
·
- Miscellaneous
·
- Simple Code to Navigate through Grid according to User press key
Simple Code to Navigate through Grid according to User press key
Simple Code to Navigate through Grid according to User press key
Rate Simple Code to Navigate through Grid according to User press key
(1(1 Vote))
MoveToList MSFlexGrid1, KeyAscii, 1
End Sub
Public Sub MoveToList(Obj As MSFlexGrid, KeyAscii As Integer, Optional intCol As Integer)
'This is pocedurce for to navigate in the list whent the user press any key
Dim intRow As Integer
Dim intStartRow As Integer
Dim blnFlag As Boolean
If Obj.Rows = 1 Then Exit Sub
If Obj.Row <> Obj.Rows - 1 Then
intStartRow = Obj.Row + 1
Else
intStartRow = 1
End If
For intRow = intStartRow To Obj.Rows - 1
If UCase(Chr(KeyAscii)) = UCase(Left(Trim(Obj.TextMatrix(intRow, intCol)), 1)) Then
Obj.TopRow = intRow
Obj.Row = intRow
Obj.ColSel = Obj.Cols - 1
GoTo EndHere
Else
blnFlag = True
End If
Next intRow
If blnFlag = False Then GoTo EndHere
For intRow = 1 To intStartRow - 1
If UCase(Chr(KeyAscii)) = UCase(Left(Trim(Obj.TextMatrix(intRow, intCol)), 1)) Then
Obj.TopRow = intRow
Obj.Row = intRow
Obj.ColSel = Obj.Cols - 1
Exit For
End If
Next intRow
EndHere:
End Sub
Simple Code to Navigate through Grid according to User press key Comments
No comments yet — be the first to post one!
Post a Comment