Dear friends,

I've a problem with SendKeys on EvB.

I want change of focus control with Enter Key.

I think make:

Private Sub Form_KeyPress(KeyAscii As Integer)

If KeyAscii = vbKeyReturn Then

SendKeys vbKeyTab

End If

End Sub

When I execute my program, it generate error:
"An error was encountered while running this program: Variable is Udefined:
'SendKeys'"

¿Anybody know how simulate push tab key?

Best Regards

Alamo.

Re: SendKeys EVB by Pete

Pete
Tue Nov 11 05:07:04 CST 2003

Hi,
sendkeys doesn't exist in eVB - you need the keybd_event API - details below

Public Declare Sub keybd_event Lib "coredll.dll" (ByVal bVK As Byte, ByVal
bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)
Const VK_LEFT = &H25
Const VK_RETURN = &HD
Const VK_ALT = 18
Const VK_C = 67
Const VK_D = 68
Const VK_I = 73
Const VK_Esc = 27
Const KEYEVENTF_KEYUP = &H2


keybd_event VK_RETURN, 0, KEYEVENTF_KEYUP, 0

HTH

Pete
--
Pete Vickers
Microsoft Windows Embedded MVP
HP Business Partner
http://www.gui-innovations.com

"Alamo" <alamo@alamo.com> wrote in message
news:OnFNh6DqDHA.1324@TK2MSFTNGP09.phx.gbl...
> Dear friends,
>
> I've a problem with SendKeys on EvB.
>
> I want change of focus control with Enter Key.
>
> I think make:
>
> Private Sub Form_KeyPress(KeyAscii As Integer)
>
> If KeyAscii = vbKeyReturn Then
>
> SendKeys vbKeyTab
>
> End If
>
> End Sub
>
> When I execute my program, it generate error:
> "An error was encountered while running this program: Variable is
Udefined:
> 'SendKeys'"
>
> ¿Anybody know how simulate push tab key?
>
> Best Regards
>
> Alamo.
>
>