Pages: 1
Print
Author Topic: Controlling the tab order of elements in an xft form  (Read 3393 times)
dcramer
Member

Posts: 120


« on: March 16, 2010, 09:04:39 AM »

Hi there,
How can I control the order in which elements in an xft form are selected when tabbing through the form?

Thanks,
David
Logged

David Cramer
Technical Writer
Motive, an Alcatel-Lucent Company
Derek Read
Program Manager (XMetaL)
Administrator
Member

Posts: 2621



WWW
« Reply #1 on: March 16, 2010, 02:34:53 PM »

If you are looking for something like VB has, where you can give controls a number, we don't have that unfortunately. That would be nice I agree, but the solution is simple because the tab order is added to each item you place on a form as you add it.

There are two options:

1. Once your form is built the way you like, remove each item using Cut (Ctrl+X) followed immediately by Paste (Ctrl+V) to put it back where it was. Do this for each control in the order you wish them to be tabbed to.

2. This is the better solution as it offers you assurance that things will be done correctly (ie: you can examine your code to see the tab order). Inside an event (like OnInitialize) write a script that hides then shows each of the controls you wish to tab to:

//JScript: Fix up tab order for controls.
//First, hide everything (order here is not important).
ComboBox1.Visible = false;
ComboBox2.Visible = false;
EditBox1.Visible = false;
Button1.Visible = false;
//Second, make controls visible in the order you wish the tab order to be.
//Note that the order here is important.
ComboBox1.Visible = true;
ComboBox2.Visible = true;
EditBox1.Visible = true;
Button1.Visible = true;
« Last Edit: March 16, 2010, 06:55:56 PM by Derek Read » Logged
dcramer
Member

Posts: 120


« Reply #2 on: March 17, 2010, 07:43:34 AM »

Ok, both options are fine with me. Strange thing though, in the form editor when testing the form using F5, both methods work. However, when I invoke the macro from XMetaL, neither has any effect. I've restarted xmetal with the control key down to make sure there's no caching.

David
Logged

David Cramer
Technical Writer
Motive, an Alcatel-Lucent Company
dcramer
Member

Posts: 120


« Reply #3 on: March 17, 2010, 08:08:44 AM »

Ok, it must be some problem with that form. In another form, option 2 works fine. I'll try recreating the first form from scratch.

I would suggest adding option 2 to the documentation. It's a handy tip.

Thanks,
David
Logged

David Cramer
Technical Writer
Motive, an Alcatel-Lucent Company
Pages: 1
Print
Jump to:  

email us