tab stops.. moving to the next control using code...

A

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 ?

thanks
 
A

Armin Zingler

A

AussieRules

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...
 
A

AussieRules

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 ??
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top