Skip to main content

Some of our Windows forms are made up of tabs.

Each tab contains data relevant to the header.

My first tab on form XYZ is called 'Personal'.

The first field on tab 'Personal' is called 'Per-Code'.

My tab ORDER says that 'Per-Code' is value 0.0.0 with the Personal tab having a tab order of 0. I have no other tab values of 0.0.0 within my tab of Personal.

At runtime I use the code Invoke Per-Code::Focus() BUT on running the form the field Per-Code doesn't become active until  I press the <TAB> key when the field Per-Code then becomes 'live' and editable.

What command do I need to use to have it so that I don't have to press the <TAB> key first?

I note that this does NOT happen when I'm NOT using a tabbed form!

Some of our Windows forms are made up of tabs.

Each tab contains data relevant to the header.

My first tab on form XYZ is called 'Personal'.

The first field on tab 'Personal' is called 'Per-Code'.

My tab ORDER says that 'Per-Code' is value 0.0.0 with the Personal tab having a tab order of 0. I have no other tab values of 0.0.0 within my tab of Personal.

At runtime I use the code Invoke Per-Code::Focus() BUT on running the form the field Per-Code doesn't become active until  I press the <TAB> key when the field Per-Code then becomes 'live' and editable.

What command do I need to use to have it so that I don't have to press the <TAB> key first?

I note that this does NOT happen when I'm NOT using a tabbed form!

Are you selecting the tabpage on which the per-code textbox resides before setting the focus?

The following works for me to activate the second tab page and set focus to the textbox named testBox5:

        set self::tabControl1::SelectedIndex to 1

        invoke self::textBox5::Focus


Some of our Windows forms are made up of tabs.

Each tab contains data relevant to the header.

My first tab on form XYZ is called 'Personal'.

The first field on tab 'Personal' is called 'Per-Code'.

My tab ORDER says that 'Per-Code' is value 0.0.0 with the Personal tab having a tab order of 0. I have no other tab values of 0.0.0 within my tab of Personal.

At runtime I use the code Invoke Per-Code::Focus() BUT on running the form the field Per-Code doesn't become active until  I press the <TAB> key when the field Per-Code then becomes 'live' and editable.

What command do I need to use to have it so that I don't have to press the <TAB> key first?

I note that this does NOT happen when I'm NOT using a tabbed form!

Hi Chris,

My code reads as:

          set EmployeeMaint::SelectedTab to Personal

          invoke PER-CODE::Focus

(where EmployeeMaint is the name of my form and Personal is the FIRST tabbed page on it)

The above code DOES NOT seem to work!

(I don't know if your example code line of  set self::tabControl1::SelectedIndex to 1 was meant to be that as it simply took me to the 2nd tab in my tab pages where I have a selection box!!)


Some of our Windows forms are made up of tabs.

Each tab contains data relevant to the header.

My first tab on form XYZ is called 'Personal'.

The first field on tab 'Personal' is called 'Per-Code'.

My tab ORDER says that 'Per-Code' is value 0.0.0 with the Personal tab having a tab order of 0. I have no other tab values of 0.0.0 within my tab of Personal.

At runtime I use the code Invoke Per-Code::Focus() BUT on running the form the field Per-Code doesn't become active until  I press the <TAB> key when the field Per-Code then becomes 'live' and editable.

What command do I need to use to have it so that I don't have to press the <TAB> key first?

I note that this does NOT happen when I'm NOT using a tabbed form!

Hi Mark,

Yes, my demo just set the second tab page on the tabcontrol to be the current page before it set the focus to one of the controls on that tab page.

Please open up a support incident for this and attach a small demo to recreate the problem.

Please mention that you would like it assigned to me and then post the incident number here and I will take a look at it.

Thanks.


Some of our Windows forms are made up of tabs.

Each tab contains data relevant to the header.

My first tab on form XYZ is called 'Personal'.

The first field on tab 'Personal' is called 'Per-Code'.

My tab ORDER says that 'Per-Code' is value 0.0.0 with the Personal tab having a tab order of 0. I have no other tab values of 0.0.0 within my tab of Personal.

At runtime I use the code Invoke Per-Code::Focus() BUT on running the form the field Per-Code doesn't become active until  I press the <TAB> key when the field Per-Code then becomes 'live' and editable.

What command do I need to use to have it so that I don't have to press the <TAB> key first?

I note that this does NOT happen when I'm NOT using a tabbed form!

Hi Chris,

Have submitted incident. Number 2609069. Marked for your attention.

Problem is getting program to focus on the first field on TABPAGE1 straight away in same with as focusing on first field on form. e.g looking like its editable!


Some of our Windows forms are made up of tabs.

Each tab contains data relevant to the header.

My first tab on form XYZ is called 'Personal'.

The first field on tab 'Personal' is called 'Per-Code'.

My tab ORDER says that 'Per-Code' is value 0.0.0 with the Personal tab having a tab order of 0. I have no other tab values of 0.0.0 within my tab of Personal.

At runtime I use the code Invoke Per-Code::Focus() BUT on running the form the field Per-Code doesn't become active until  I press the <TAB> key when the field Per-Code then becomes 'live' and editable.

What command do I need to use to have it so that I don't have to press the <TAB> key first?

I note that this does NOT happen when I'm NOT using a tabbed form!

Hi Chris,

Have submitted incident. Number 2609069. Marked for your attention.

Problem is getting program to focus on the first field on TABPAGE1 straight away in same with as focusing on first field on form. e.g looking like its editable!


Some of our Windows forms are made up of tabs.

Each tab contains data relevant to the header.

My first tab on form XYZ is called 'Personal'.

The first field on tab 'Personal' is called 'Per-Code'.

My tab ORDER says that 'Per-Code' is value 0.0.0 with the Personal tab having a tab order of 0. I have no other tab values of 0.0.0 within my tab of Personal.

At runtime I use the code Invoke Per-Code::Focus() BUT on running the form the field Per-Code doesn't become active until  I press the <TAB> key when the field Per-Code then becomes 'live' and editable.

What command do I need to use to have it so that I don't have to press the <TAB> key first?

I note that this does NOT happen when I'm NOT using a tabbed form!

Chris,

Much appreciated. Problem now solved as:

The following seems to work from within the New event:

set tabControl1::SelectedTab to Personal

set self::ActiveControl to Per-Code

or

Use event in Form1 - Shown

set tabControl1::SelectedTab to Personal

invoke Per-Code::Focus()

Cheers!