Focusing in on a Textbox?
I have a textbox defined called PER-CODE.
PER-CODE has properties of TabIndex = 0, indicating that the field SHOULD be the first field I enter on the screen.
Despite this I must press the TAB key once before my field is highlighted and I'm able to enter data.
Have tried INVOKE PER-Code::Focus() prior to screen launch but this makes no difference.
How do I make it so that the field PER-CODE takes input straight away once the form loads?
What control is the focus being set to?
f you select View-->Tab Order from the IDE menu it will show you the current tab order on the form.
In order to use focus to change the main focus you should place it in the Form_Activated event.
method-id Form1_Activated final private.
procedure division using by value sender as object e as type System.EventArgs.
Thanks for that.
Just to confirm something...
When I click on the View->Tab Order on the form I see all my fields with several showing as 0.0.0.
I'm using a tabbed screen area so am I to assume that the FIRST 0 indicates the form level, the SECOND 0 indicates the TAB sequence and the THIRD 0 indicates the FIELD level.
Am I then to assume that the only 0.0.0 field that would be a VALID tab stop is where the TAB STOP property is set to TRUE?
The Tab Order is shown by priority number where the leftmost digit is the main TabIndex of the container itself and subsequent numbers are the tabindex within the container, etc.
You can change the tab order using this view Tab Order screen by clicking each control in the order that you would like them to appear in the tab order.
If you have a form which contains the following:
panel1 = 0
textbox2 = 0.0
textbox3 = 0.2
panel2 = 0.1
textbox4 = 0.1.0
button1 = 2
The taborder at run-time would be:
If any of these controls had tabstop=false set then they would be ignored.