Capturing tab control

  • Thread starter Thread starter Colin Graham
  • Start date Start date
C

Colin Graham

I have been looking with no avail at various solutions in the groups
to the problem of capturing the tab keydown while in a certain
controls. I have been trying to capture the tab keydown event but
nothing appears to be happening and it is totally ignored. I really
cannot understand why this is happening - apparently there is
something that must be overridden but im not sure on how this works.

the field in questionis yyn_Weightloss and the code im using is

Private Sub yyn_WeightLoss_KeyDown(ByVal sender As Object, ByVal e
As System.Windows.Forms.KeyEventArgs) Handles yyn_WeightLoss.KeyDown
If e.KeyCode = 9 Then
MessageBox.Show("tab caught")
fun_TabMoveNext()
Else : Exit Sub
End If
End Sub

I really do not understand why this is happening as other events are
firing correctly such as lostfocus.

Can anyone be of assistance on this issue.

Thanks in advance
 
Colin said:
I have been looking with no avail at various solutions in the groups

Can anyone be of assistance on this issue.

You'll need to ask in a .Net group. They all contain "dotnet" or "vsnet"
in their names.
 
[Trimmed irrelevant newsgroups]

Try overriding ProcessCmdKey in the control where
you want to handle the tab key

/claes
 
Back
Top