General XMetaL Discussion

XMetaL Community Forum General XMetaL Discussion Controlling the tab order of elements in an xft form

  • dcramer

    Controlling the tab order of elements in an xft form

    Participants 2
    Replies 3
    Last Activity 12 years, 3 months ago

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

    Thanks,
    David

    Reply

    Derek Read

    Reply to: Controlling the tab order of elements in an xft form

    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;

    Reply

    dcramer

    Reply to: Controlling the tab order of elements in an xft form

    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

    Reply

    dcramer

    Reply to: Controlling the tab order of elements in an xft form

    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

    Reply

  • You must be logged in to reply to this topic.

Lost Your Password?

Products
Downloads
Support