|
|
tab stops.. moving to the next control using code...
I have a number of controls on my form, set with tabindexs and tabstop set
to true.
My application runs on a touch screen, and I want the focus to move from one
control to the other when the user pushed a button.
Is there a way to move the focus to the next control based on its tabstop
being the next highest ?
thanks
|
|
0
|
|
|
|
Reply
|
AussieRules
|
5/13/2010 1:36:59 PM |
|
Am 13.05.2010 15:36, schrieb AussieRules:
> I have a number of controls on my form, set with tabindexs and tabstop set
> to true.
>
> My application runs on a touch screen, and I want the focus to move from one
> control to the other when the user pushed a button.
>
> Is there a way to move the focus to the next control based on its tabstop
> being the next highest ?
http://msdn.microsoft.com/en-us/library/system.windows.forms.control.selectnextcontrol.aspx
--
Armin
|
|
0
|
|
|
|
Reply
|
Armin
|
5/13/2010 2:36:07 PM
|
|
Update:
I have been trying out the following idea :
i have declared
private currentcontrol as control in my forms declaration...
Then in the textbox.enter event i sent the current control to be the next
box.
Then the code behind my button does this:
Dim nextcontrol As Control
nextcontrol = Me.GetNextControl(currencontrol, True)
nextcontrol.Focus()
but this doesn't work for some reason...
"AussieRules" <nospam@nospam.com> wrote in message
news:uIAYeFq8KHA.3276@TK2MSFTNGP02.phx.gbl...
>I have a number of controls on my form, set with tabindexs and tabstop set
>to true.
>
> My application runs on a touch screen, and I want the focus to move from
> one control to the other when the user pushed a button.
>
> Is there a way to move the focus to the next control based on its tabstop
> being the next highest ?
>
> thanks
>
|
|
0
|
|
|
|
Reply
|
AussieRules
|
5/13/2010 2:52:02 PM
|
|
Hi Armin,
Thanks for you reply.
I have tried out the solution you provided. but am having a problem.
The problem is that I am trying to move the focus from control to
control(text boxes) when the user pushes a form button. (its a touch screen
app so no keyboard)
I have declared a control (dim currentcontrol as control in my form), on the
control.enter I set this currentcontrol = to the control that has been
entered (currentcontrol = textbox)
The tab orders are all set properly.
When the user pushes the button on my form nothing happens.. the code behind
this button is:
currentcontrol.SelectNextControl(currentcontrol, True, True, False, True)
any tips on how to solve this ??
"Armin Zingler" <az.nospam@freenet.de> wrote in message
news:u1ZWDoq8KHA.5848@TK2MSFTNGP06.phx.gbl...
> Am 13.05.2010 15:36, schrieb AussieRules:
>> I have a number of controls on my form, set with tabindexs and tabstop
>> set
>> to true.
>>
>> My application runs on a touch screen, and I want the focus to move from
>> one
>> control to the other when the user pushed a button.
>>
>> Is there a way to move the focus to the next control based on its tabstop
>> being the next highest ?
>
> http://msdn.microsoft.com/en-us/library/system.windows.forms.control.selectnextcontrol.aspx
>
> --
> Armin
|
|
0
|
|
|
|
Reply
|
AussieRules
|
5/13/2010 2:58:27 PM
|
|
|
3 Replies
715 Views
(page loaded in 0.06 seconds)
|
|
|
|
|
|
|
|
|