M
Mr. Smith
Hi.
I have a form with 144 text boxes. 12 rows/12 columns. When the usere use
the down arrow key, the next text box in the taborder get focus. Nice
enought. this takes care of the "up/down" navigation.
However I want to cath left/right arrows also, to allow sideways navigation.
Suggested logic.
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
Select Case KeyCode
Case 39 Then 'Right arrow
Controls(Screen.ActiveControl.TabIndex + 12).SetFocus
Case 37
Controls(Screen.ActiveControl.TabIndex - 12).SetFocus
End Select
End Sub
Silly thing is that this only works on a form when no control got focus
(like never.....)
I tried to make a function
Public function KeyDown(KeyCode as integer)
'Do navigation
End function
But how do i pass the KeyCode as a parameter from "OnKeyDown" event on a
text box?
I set the "OnKeyDown" event on all 144 text boxes to =KeyDown(), but I needs
the keycode as parameter.
As you might understand I'm trying to build a standard cell matrix with
"Excel" feeling through textbox mosaic, and that is the hole point, as it
alows "super" flexible development on a later stage in the application....
Kind regards
Mr. Smith
I have a form with 144 text boxes. 12 rows/12 columns. When the usere use
the down arrow key, the next text box in the taborder get focus. Nice
enought. this takes care of the "up/down" navigation.
However I want to cath left/right arrows also, to allow sideways navigation.
Suggested logic.
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
Select Case KeyCode
Case 39 Then 'Right arrow
Controls(Screen.ActiveControl.TabIndex + 12).SetFocus
Case 37
Controls(Screen.ActiveControl.TabIndex - 12).SetFocus
End Select
End Sub
Silly thing is that this only works on a form when no control got focus
(like never.....)
I tried to make a function
Public function KeyDown(KeyCode as integer)
'Do navigation
End function
But how do i pass the KeyCode as a parameter from "OnKeyDown" event on a
text box?
I set the "OnKeyDown" event on all 144 text boxes to =KeyDown(), but I needs
the keycode as parameter.
As you might understand I'm trying to build a standard cell matrix with
"Excel" feeling through textbox mosaic, and that is the hole point, as it
alows "super" flexible development on a later stage in the application....
Kind regards
Mr. Smith