B4J Question Change Control's Tab order via code?

DMW

Member
Licensed User
Hi,

I'm aware of that we can manually can change control's tab order.

But is it possible to do it via code? If yes, please provide a sample code.

TIA,
Dennis
 

jmon

Well-Known Member
Licensed User
Hi,

this works for me:

B4X:
'get the tab page at pos 0
Dim tab0 As TabPage =  tabp.Tabs.Get(0)
'remove tab 0 from the tabPane
tabp.Tabs.RemoveAt(0)
'add tab 0 back to the tabPane (at the end):
tabp.Tabs.Add(tab0)

this too:
B4X:
'get the tab page at pos 0
Dim tab0 As TabPage = tabp.Tabs.Get(0)
'remove tab 0 from the tabPane
tabp.Tabs.RemoveAt(0)
'add tab 0 to the position 5 in the tabpane:
tabp.Tabs.InsertAt(5, tab0)
 
Upvote 0

DMW

Member
Licensed User
Thank You for Your input.

Sorry, my poor English seems to prevent me from asking the question the right way.

It has nothing to do with the TAB Pane and its Tabs.

In forms we can move between the controls (TextField, TextArea, Combobox etx) by using the TAB-button on the keyboard.
We can change the TAB order by moving controls manually up and down in the TreeView in the Designer.

In a project I have one JavaFX control that is added via code. By design B4J place it last in the TAB order of the Form.

My question is: Can we change the TAB order of the JavaFX control in the Form?
 
Upvote 0

DMW

Member
Licensed User
Sorry for late reply...

The only way to change the tabs order at runtime is by changing the nodes order. What do you need it for?

I have placed a Java Spinner Control (in a pane) among other native controls. The pane has the correct tab order but the Java spinner control ends up as the last tab.
 
Upvote 0

DMW

Member
Licensed User
Thanks!

When creating the layout from scratch again I was able to get the tab order I wanted :)

Thanks for Your patient and support.
 
Upvote 0
Top