OK, so then you should be working in the ProcessTabKey Method.
Protected Overrides Function ProcessTabKey(ByVal forward As Boolean) As
Boolean
Dim ac As Control = Me.ActiveControl
If forward Then
If ac Is TextBox1 Then
fun_TabMoveNext()
Return True
End If
Else
If ac Is TextBox1 Then
fun_TabMoveBack()
Return True
End If
End If
Return MyBase.ProcessTabKey(forward)
End Function
--
Mick Doherty
http://dotnetrix.co.uk/nothing.html
"Colin Graham" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Thanks very much for that its helped me alot. i now have another tiny
> problem though see code below.
>
> Protected Overrides Function ProcessCmdKey(ByRef msg As
> System.Windows.Forms.Message, ByVal keyData As
> System.Windows.Forms.Keys) As Boolean
>
>
> If Me.ActiveControl Is yyn_WeightLoss Or _
> Me.ActiveControl Is yyn_RectalBleeding Or _
> Me.ActiveControl Is yyn_TubeDifficulties Or _
> Me.ActiveControl Is yyn_XRayReport Or _
> Me.ActiveControl Is yyn_CarriedOut _
> AndAlso keyData = Keys.Tab = VK_TAB Then
>
> fun_TabMoveNext()
>
> ElseIf keyData = Keys.Tab And Control.ModifierKeys =
> Keys.ShiftKey Then
> If Me.ActiveControl Is yyn_AbdPain Or _
> Me.ActiveControl Is yyn_Diarrhoea Or _
> Me.ActiveControl Is yyn_PoorIntake Or _
> Me.ActiveControl Is txt_OtherReason Or _
> Me.ActiveControl Is dtp_ProcedureDate Then
>
> fun_TabMoveBack()
>
> Return True
> End If
> End If
>
> Return MyBase.ProcessCmdKey(msg, keyData)
>
> End Function
>
> Im trying to catch the shift tab for navigation through the tab
> control i.e., shift + tab (back) and tab (Forward). My problem seems
> to be that it sees the shift key as a tab key key and moves forwards
> when i press shift and im on one of the fields for moving forwards.
> any idea who i can trap for purely just shift + tab?? ive read a few
> other threads with no avail.
>
> Thanks
>
> CG
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (
http://www.grisoft.com).
Version: 6.0.719 / Virus Database: 475 - Release Date: 12/07/2004