Hi again OHM,
thanks for the below suggestion I tried this and it didn't work or
didn't work consistantly.. what I've eventually done - and this is a
little clumsy - but is now working the way I want is the following:
Created a custom control button in which I put the following
Protected Overrides Function ProcessCmdKey(ByRef msg As
System.Windows.Forms.Message, ByVal keyData As
System.Windows.Forms.Keys) As Boolean
Select Case CType(msg.WParam.ToInt32, Keys)
Case Keys.Enter
bln_enterKeyPressed = True
Return True
Case Else
bln_enterKeyPressed = False
Return MyBase.ProcessCmdKey(msg, keyData)
End Select
End Function
Public ReadOnly Property EnterKeyPressed() As Boolean
Get
Return bln_enterKeyPressed
End Get
End Property
Basically doesn't respond to the enter key but the property records
that the
enter key was pressed & then in the form that the custom control
button sits on:-
Private Sub cc_TabPageButton_KeyUp(ByVal sender As Object, ByVal e As
System.Windows.Forms.KeyEventArgs) Handles cc_TabPageButton.KeyUp
If e.KeyCode = Keys.Tab Then ' - ignore the tabkey as the user
will have tabbed to the control
Else
If cc_TabPageButton.EnterKeyPressed Then
ButtonDualHandler()
End If
End If
End Sub
Private Sub cc_TabPageButton_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles cc_TabPageButton.Click
ButtonDualHandler()
End Sub
Thanks again for your replies, they helped to point me in the right
direction
Regards
Suzanne
"One Handed Man \( OHM - Terry Burns \)" <news.microsoft.com> wrote in message news:<#H*************@TK2MSFTNGP11.phx.gbl>...
What I have discovered is that if you trap the keyPress/Down/Upo events,
they never get fired on a Tab Page. If you disable the Causes Validation on
the TabControl ( not the Tab Pages ), pressing the Enter key has the effect
of firing the Buttons_Click Event.
HTH
--
OHM ( Terry Burns ) * Use the following to email me *
Dim ch() As Char = "ufssz/cvsotAhsfbuTpmvujpotXjui/OFU".ToCharArray()
For i As Int32 = 0 To ch.Length - 1
ch(i) = Convert.ToChar(Convert.ToInt16(ch(i)) - 1)
Next
Process.Start("mailto:" & New String(ch))
--