alungwyther
asked on
Skip a cell on TAB in datagridview
Hi
I need to skip a cell, that is read only, when the user presses the Tab key.
I have tried the following code to skip over column 2
Protected Overrides Function ProcessCmdKey(ByRef msg As System.Windows.Forms.Messa ge, ByVal keyData As System.Windows.Forms.Keys) As Boolean
Select Case keyData
Case Keys.Tab
If grdHSE.CurrentCell.ColumnI ndex = 1 Then
grdHSE.CurrentCell = grdHSE(3, grdHSE.CurrentCell.RowInde x)
End If
End Select
End Function
but it skips to column 4 not 3.
All help much appreciated.
Best Regards
Alun Gwyther
I need to skip a cell, that is read only, when the user presses the Tab key.
I have tried the following code to skip over column 2
Protected Overrides Function ProcessCmdKey(ByRef msg As System.Windows.Forms.Messa
Select Case keyData
Case Keys.Tab
If grdHSE.CurrentCell.ColumnI
grdHSE.CurrentCell = grdHSE(3, grdHSE.CurrentCell.RowInde
End If
End Select
End Function
but it skips to column 4 not 3.
All help much appreciated.
Best Regards
Alun Gwyther
try setting the StandardTab property of the Datagridview to TRUE (and remove the manual key processing)
ASKER
Hi
Thanks for the reply.
If I do that then the focus goes to the next control in the tab order on the form.
Best Regards
Alun Gwyther
Thanks for the reply.
If I do that then the focus goes to the next control in the tab order on the form.
Best Regards
Alun Gwyther
what i normally do is onkeypress
if e.keycode=tab then
sendkeys.send("{RIGHT}")
end if
this gets me to where i want to be
if e.keycode=tab then
sendkeys.send("{RIGHT}")
end if
this gets me to where i want to be
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hi Roger
Many thanks, that did the trick.
Alun
Many thanks, that did the trick.
Alun