Jan 8, 2014 Replies: 43 The TabPane container allows the user to switch between different tab pages. Working with TabPane is similar to working with SplitPane. Each page is made of a different layout file. The most important point is to use anchors in the pages layouts. This way the layouts will be resized automatically when the TabPane is resized. For example the following code adds two pages. The second parameter is the tab title. Tab1 and Tab2 are layout files. Code: Sub AppStart (Form1 As Form, Args() As String) MainForm = Form1 MainForm.SetFormStyle("UNIFIED") MainForm.RootPane.LoadLayout("Main") TabPane1.LoadLayout("Tab1", "Tab 1") TabPane1.LoadLayout("Tab2", "Tab 2") MainForm.Show End Sub TabPane.LoadLayout returns a TabPage object. You can use this object to further configure the page. The example is attached. Attachments TabPane.zip TabPane.zip 6.8 KB · Views: 2,524 Last edited: Jan 7, 2016 Click to expand...
The TabPane container allows the user to switch between different tab pages. Working with TabPane is similar to working with SplitPane. Each page is made of a different layout file. The most important point is to use anchors in the pages layouts. This way the layouts will be resized automatically when the TabPane is resized. For example the following code adds two pages. The second parameter is the tab title. Tab1 and Tab2 are layout files. Code: Sub AppStart (Form1 As Form, Args() As String) MainForm = Form1 MainForm.SetFormStyle("UNIFIED") MainForm.RootPane.LoadLayout("Main") TabPane1.LoadLayout("Tab1", "Tab 1") TabPane1.LoadLayout("Tab2", "Tab 2") MainForm.Show End Sub TabPane.LoadLayout returns a TabPage object. You can use this object to further configure the page. The example is attached.
rwblinn Well-Known Member Licensed User Longtime User Jan 8, 2014 #2 Hi Erel, thanks for this enhancement - very good. Hint for those who already have been using tabpane prior B4J v1.06: Change the tabpane type from Node to TabPane. This enables to use all the new properties and methods, like selectedindex, etc... I noticed that the B4J Documentation has not been updated (yet).
Hi Erel, thanks for this enhancement - very good. Hint for those who already have been using tabpane prior B4J v1.06: Change the tabpane type from Node to TabPane. This enables to use all the new properties and methods, like selectedindex, etc... I noticed that the B4J Documentation has not been updated (yet).
Erel B4X founder Staff member Licensed User Longtime User Jan 9, 2014 #3 I noticed that the B4J Documentation has not been updated (yet). Click to expand... Fixed.
luciano deri Active Member Licensed User Longtime User Sep 3, 2014 #4 Hy, is possible add a scrollview in a tab?
Erel B4X founder Staff member Licensed User Longtime User Sep 3, 2014 #5 Are you asking about B4J? Is it is possible to add a ScrollPane to a TabPane.
luciano deri Active Member Licensed User Longtime User Sep 3, 2014 #6 No, i'm sorry. I asking about B4A, i need scroolview on tabhost or similar component.
Erel B4X founder Staff member Licensed User Longtime User Sep 4, 2014 #7 Please start a new thread in B4A forum.
delozoya Member Licensed User Longtime User Dec 3, 2014 #8 How change the Width of tab? Or only change depending the name of tab? Thanks
Erel B4X founder Staff member Licensed User Longtime User Dec 4, 2014 #9 The width changes automatically based on the tab name.
delozoya Member Licensed User Longtime User Dec 4, 2014 #10 Anh height? The problem is that is a touch screen and is a small tab
Erel B4X founder Staff member Licensed User Longtime User Dec 4, 2014 #11 You can use this sub: Code: Sub SetMinTabSize(tp As TabPane, width As Double, height As Double) Dim jo As JavaObject = tp jo.RunMethod("setTabMinWidth", Array(width)) jo.RunMethod("setTabMinHeight", Array(height)) End Sub
You can use this sub: Code: Sub SetMinTabSize(tp As TabPane, width As Double, height As Double) Dim jo As JavaObject = tp jo.RunMethod("setTabMinWidth", Array(width)) jo.RunMethod("setTabMinHeight", Array(height)) End Sub
CHAUVET Member Licensed User Longtime User Jan 16, 2015 #13 Hello everyone, In tabpane with 4 tabpage I have 4 headers (tab1 / tab2 / tab3 / tab4) How can we do for a TAB HEADER is not clickable? Move from tab enabled to disable stat of tab item ? For example: Public Tabpane1 As TabPane Tabpane1.header(1).enabled = false '(This code is wrong it's just for example) thank you,
Hello everyone, In tabpane with 4 tabpage I have 4 headers (tab1 / tab2 / tab3 / tab4) How can we do for a TAB HEADER is not clickable? Move from tab enabled to disable stat of tab item ? For example: Public Tabpane1 As TabPane Tabpane1.header(1).enabled = false '(This code is wrong it's just for example) thank you,
Erel B4X founder Staff member Licensed User Longtime User Jan 18, 2015 #14 You can disable all tabs except of one tab: Code: Sub DisableAllTabsExceptOf(TabPane As TabPane, page As TabPage) For Each tp As TabPage In TabPane.Tabs Dim jo As JavaObject = tp jo.RunMethod("setDisable", Array(tp <> page)) Next End Sub Use this sub to disable all tabs except of the one you want to show.
You can disable all tabs except of one tab: Code: Sub DisableAllTabsExceptOf(TabPane As TabPane, page As TabPage) For Each tp As TabPage In TabPane.Tabs Dim jo As JavaObject = tp jo.RunMethod("setDisable", Array(tp <> page)) Next End Sub Use this sub to disable all tabs except of the one you want to show.
S StarinschiAndrei Active Member Licensed User Longtime User Jun 13, 2015 #16 Hi , How can i set the image height and width if i load the image from database ? my code : Code: inputstreamDept.InitializeFromBytesArray(bufferImgDept,0,bufferImgDept.Length) Dim bmpDept As Image bmpDept.Initialize2(inputstreamDept) page.Image=bmpDept on this way the image doesn't fit in tab. i'd like to use page.Image=fx.LoadImageSample(????,height,width) Last edited: Jun 13, 2015
Hi , How can i set the image height and width if i load the image from database ? my code : Code: inputstreamDept.InitializeFromBytesArray(bufferImgDept,0,bufferImgDept.Length) Dim bmpDept As Image bmpDept.Initialize2(inputstreamDept) page.Image=bmpDept on this way the image doesn't fit in tab. i'd like to use page.Image=fx.LoadImageSample(????,height,width)
Erel B4X founder Staff member Licensed User Longtime User Jun 14, 2015 #17 Create an ImageView with the desired size and set this image to the ImageView. Use this code to add the ImageView to the TabPage: Code: Dim jo As JavaObject = TabPage1 jo.RunMethod("setGraphic", Array(ImageView1))
Create an ImageView with the desired size and set this image to the ImageView. Use this code to add the ImageView to the TabPage: Code: Dim jo As JavaObject = TabPage1 jo.RunMethod("setGraphic", Array(ImageView1))
S StarinschiAndrei Active Member Licensed User Longtime User Jun 14, 2015 #18 Erel said: Create an ImageView with the desired size and set this image to the ImageView. Use this code to add the ImageView to the TabPage: Code: Dim jo As JavaObject = TabPage1 jo.RunMethod("setGraphic", Array(ImageView1)) Click to expand... Thank you it works
Erel said: Create an ImageView with the desired size and set this image to the ImageView. Use this code to add the ImageView to the TabPage: Code: Dim jo As JavaObject = TabPage1 jo.RunMethod("setGraphic", Array(ImageView1)) Click to expand... Thank you it works
S StarinschiAndrei Active Member Licensed User Longtime User Jun 14, 2015 #19 Erel said: Are you asking about B4J? Is it is possible to add a ScrollPane to a TabPane. Click to expand...
Erel said: Are you asking about B4J? Is it is possible to add a ScrollPane to a TabPane. Click to expand...
S StarinschiAndrei Active Member Licensed User Longtime User Jun 14, 2015 #20 Hi , How can i make my tab page scrollable ? Thank you