Advanced from with keyboard

hamid

Centurion
Joined
Jul 13, 2004
Messages
114
hi,
i want design an advanced form that:
1.change focus between textboxs when user press Enter or up-down arrow keys.
2.run button clicked function when user press Insert-Delete Keyboard buttons.
in fact
when user press enter focus change to next textbox and when press insert button on keyboard do function insert.
HELP ME
 
how can i use of Me.SelectNextControl()? there is more than one parameter needed in this function. and how can find next control?
 
Well, you go through each parameter and make the best decision on which will get you to the next control. :)

Public Function SelectNextControl(ByVal ctl As System.Windows.Forms.Control, ByVal forward As Boolean, ByVal tabStopOnly As Boolean, ByVal nested As Boolean, ByVal wrap As Boolean) As Boolean

So let's see...
ctl: You can use Me.ActiveControl to get the active control...
forward: I guess you want to go forward, so this'll be true.
tabStopOnly: I guess you want to skip over non-tabbable (?) controls, so this'll be true
nested: I guess you want to go to select nested controls, so this'll be true
wrap: I guess you want to go back to the first control when at the end, so this'll be true.

And this function will find the next control.
 
hey Iceplug u r fantastic ;) thx :)
i did it but i have a problam that when control set to a textbox that is multiline this dont work in up/down arrow key
(sorry for my bad english :o )
i have a textbox (multiline) when i press up or down key it dont work to change focus!

btw thank u very much :cool:
 
Back
Top