Author |
Message |
Julian Brigh #1 / 10
|
 Send Keys effects Num-Lock
Hi there, I am making use of the flex-grid, and are using SendKeys with the various arrows to move through the grid manually. But when I send this command the num-lock flashes every time, and CAN change state - which is very unhelpful when entering data using the number pad. Is there any way around this - perhaps sending a message to the flex grid to move to a cell?? I would really appreciate any feedback, Thanks, Julian.
|
Sun, 14 Jan 2001 03:00:00 GMT |
|
 |
Kjell Hanse #2 / 10
|
 Send Keys effects Num-Lock
Hi all, I've run into the same problem as Julian, not just with the flex-grid but with textboxes aswell. I'm using the SendKeys"{tab}" to move focus on Keypress=enter. Are we doing the right thing??!? TIA /Kjell Hansen
|
Sun, 14 Jan 2001 03:00:00 GMT |
|
 |
Dev Ashis #3 / 10
|
 Send Keys effects Num-Lock
Hi Julian, The problem with Sendkeys playing with NumLock is well known, well at least in the MS Office environment. But I think it affects VB as well. Possible workarounds: Don't use 'em :); if you must, then pack the separate Sendkeys into one statement, instead of multiple Sendkeys; put a DoEvents between different SendKeys statement. HTH -- Dev Ashish (Just my $.001) --------------- The Access Web ( http://home.att.net/~dashish ) ---------------
:Hi there, : :I am making use of the flex-grid, and are using SendKeys with the various :arrows to move through the grid manually. But when I send this command the :num-lock flashes every time, and CAN change state - which is very unhelpful :when entering data using the number pad. : :Is there any way around this - perhaps sending a message to the flex grid to :move to a cell?? : :I would really appreciate any feedback, : :Thanks, :Julian. : :
|
Wed, 17 Jan 2001 03:00:00 GMT |
|
 |
Kjell Hanse #4 / 10
|
 Send Keys effects Num-Lock
Hi Graham Thanx for your effort. I _sounds_ like it's the solution to my problem. With the warningbeeps on CapsLock and NumLock turned on it's very anoying. Regards Kjell Hansen
|
Fri, 26 Jan 2001 03:00:00 GMT |
|
 |
Kjell Hanse #5 / 10
|
 Send Keys effects Num-Lock
Sorry Graham :-( The idea of using SendMessage instead of SendKeys was good, but it didn't work out for me. I want the focus moved from one textbox to the next in tab order when pressing the Enter key. My code is as follows: Private Sub Text1_KeyPress(KeyAscii As Integer) If KeyAscii = vbKeyReturn Then SendTab End If End Sub Sub SendTab() Dim l_ret As Long l_ret = SendMessageByNum(Screen.ActiveControl.hWnd, WM_CHAR, 9, 0) End Sub All I get when pressing Enter is a double beep (both from the Keypress event on a non writeable char, i.e. 13, 9) How do I make the focus move to the next textbox on pressing Enter?? TIA Kjell Hansen
|
Sun, 28 Jan 2001 03:00:00 GMT |
|
 |
René Whitwort #6 / 10
|
 Send Keys effects Num-Lock
Doesn't the FORM handle the Tab key ? You should set KeyAscii to 0 in the KeyPress event Hope this helps ... Whitworth Software Solutions Ren Whitworth
www.geocities.com/SiliconValley/8928 (under construction)
Quote: >Sorry Graham :-( >The idea of using SendMessage instead of SendKeys was good, but it >didn't work out for me. >I want the focus moved from one textbox to the next in tab order when >pressing the Enter key. >My code is as follows: > Private Sub Text1_KeyPress(KeyAscii As Integer) > If KeyAscii = vbKeyReturn Then > SendTab > End If > End Sub > Sub SendTab() > Dim l_ret As Long > l_ret = SendMessageByNum(Screen.ActiveControl.hWnd, > WM_CHAR, 9, 0) > End Sub >All I get when pressing Enter is a double beep (both from the Keypress >event on a non writeable char, i.e. 13, 9) >How do I make the focus move to the next textbox on pressing Enter?? >TIA >Kjell Hansen
|
Sun, 28 Jan 2001 03:00:00 GMT |
|
 |
Kjell Hanse #7 / 10
|
 Send Keys effects Num-Lock
Quote:
> You should set KeyAscii to 0 in the KeyPress event
Yes, I should.But that's not my problem. The problem is that focus don't move on pressing enter. Quote: > Doesn't the FORM handle the Tab key ?
Come again?? Regards Kjell
|
Fri, 02 Feb 2001 03:00:00 GMT |
|
 |
René Whitwort #8 / 10
|
 Send Keys effects Num-Lock
Private Sub Form_KeyPress(KeyAscii As Integer, Shift As Integer) If KeyAscii = vbKeyReturn And Shift = 0 Then KeyAscii = 0 SendKeys "{Tab}" End If End Sub Copy - Paste the above code to your app and try it (be shure to have KeyPreview of the form set to True) Hope this helps ... Whitworth Software Solutions Ren Whitworth
http://www.geocities.com/SiliconValley/8928 (under construction)
Quote:
>> You should set KeyAscii to 0 in the KeyPress event >Yes, I should.But that's not my problem. The problem is that focus don't >move on pressing enter. >> Doesn't the FORM handle the Tab key ? >Come again?? >Regards >Kjell
|
Fri, 02 Feb 2001 03:00:00 GMT |
|
 |
Kjell Hanse #9 / 10
|
 Send Keys effects Num-Lock
Sorry Ren I want to get around sendkeys since it's affecting the Num-lock. That's the starting point of the discussion! /Kjell Hansen
|
Sun, 04 Feb 2001 03:00:00 GMT |
|
 |
Kjell Hanse #10 / 10
|
 Send Keys effects Num-Lock
Well, maybe it shouldn't It does anyway. Try the Accessibility Options and turn on sounds for changing the CapsLock- and NumLock-status, then you'll hear its changes. Very annoying... Give my regards to Jeeves /Kjell Quote:
> Kjell, I believe SendKeys only affects NumLock in special > circumstances. It's when multiple SendKeys are sent in quick > succession. It shouldn't happen with an isolated key being sent, and > it shouldn't happen when a single SendKeys is used to send a string of > keys. (That's from memory of a KB article I read recently.) Bertie
|
Mon, 05 Feb 2001 03:00:00 GMT |
|
|