General XMetaL Discussion
dcramer March 16, 2010 at 3:04 pm
Controlling the tab order of elements in an xft formMarch 16, 2010 at 3:04 pmParticipants 2Replies 3Last Activity 12 years, 3 months ago
How can I control the order in which elements in an xft form are selected when tabbing through the form?
DavidDerek Read March 16, 2010 at 8:34 pm
Reply to: Controlling the tab order of elements in an xft formMarch 16, 2010 at 8:34 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;dcramer March 17, 2010 at 1:43 pm
Reply to: Controlling the tab order of elements in an xft formMarch 17, 2010 at 1:43 pm
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.
Daviddcramer March 17, 2010 at 2:08 pm
Reply to: Controlling the tab order of elements in an xft formMarch 17, 2010 at 2:08 pm
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.
- You must be logged in to reply to this topic.