Dee-u
I have added the declaration and added 1 button and 1 textbox to the form.
Nothing happens to the textbox.
Any idea why???
Code:Private Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long) Private Sub Command1_Click() Me.Text1.SetFocus keybd_event VK_CONTROL, 0, 0, 0 ' press ctrl keybd_event VK_HOME, 0, 0, 0 ' press home keybd_event VK_HOME, 0, KEYEVENTF_KEYUP, 0 ' release home keybd_event VK_SHIFT, 0, 0, 0 ' press shift keybd_event VK_END, 0, 0, 0 ' press end keybd_event VK_END, 0, KEYEVENTF_KEYUP, 0 ' release end keybd_event VK_SHIFT, 0, KEYEVENTF_KEYUP, 0 ' release shift keybd_event VK_CONTROL, 0, KEYEVENTF_KEYUP, 0 ' release ctrl End Sub




Reply With Quote