Y ykucuk Well-Known Member Licensed User Longtime User Jul 15, 2019 #1 Hello, How can I access to the pane in the Tab Page? is there similar with Code: Copy GetAllViewsRecursive ?
Hello, How can I access to the pane in the Tab Page? is there similar with Code: Copy GetAllViewsRecursive ?
jmon Well-Known Member Licensed User Longtime User Jul 15, 2019 #2 Hi, Yes you can do it like that (Need JavaObject): Code: Copy Sub GetTabPanePages(Target As TabPane) As List Dim joTarget As JavaObject = Target Return joTarget.RunMethod("getTabs", Null) End Sub Code: Copy For Each v As TabPage In GetTabPanePages(tp) Log(v.Text) Next Upvote 0
Hi, Yes you can do it like that (Need JavaObject): Code: Copy Sub GetTabPanePages(Target As TabPane) As List Dim joTarget As JavaObject = Target Return joTarget.RunMethod("getTabs", Null) End Sub Code: Copy For Each v As TabPage In GetTabPanePages(tp) Log(v.Text) Next
Y ykucuk Well-Known Member Licensed User Longtime User Jul 15, 2019 #3 jmon said: Hi, Yes you can do it like that (Need JavaObject): Code: Copy Sub GetTabPanePages(Target As TabPane) As List Dim joTarget As JavaObject = Target Return joTarget.RunMethod("getTabs", Null) End Sub Code: Copy For Each v As TabPage In GetTabPanePages(tp) Log(v.Text) Next Click to expand... Thanks for the reply but exactly I asked about how to access Pane in the second Tab Page in the tab control. Upvote 0
jmon said: Hi, Yes you can do it like that (Need JavaObject): Code: Copy Sub GetTabPanePages(Target As TabPane) As List Dim joTarget As JavaObject = Target Return joTarget.RunMethod("getTabs", Null) End Sub Code: Copy For Each v As TabPage In GetTabPanePages(tp) Log(v.Text) Next Click to expand... Thanks for the reply but exactly I asked about how to access Pane in the second Tab Page in the tab control.
DonManfred Expert Licensed User Longtime User Jul 16, 2019 #4 ykucuk said: Thanks for the reply but exactly I asked about how to access Pane in the second Tab Page in the tab control. Click to expand... No one is stopping you from using a counter in the loop Code: Copy dim counter as int = 0 For Each v As TabPage In GetTabPanePages(tp) if counter=1 then Log(v.Text) end if counter = counter+1 Next Upvote 0
ykucuk said: Thanks for the reply but exactly I asked about how to access Pane in the second Tab Page in the tab control. Click to expand... No one is stopping you from using a counter in the loop Code: Copy dim counter as int = 0 For Each v As TabPage In GetTabPanePages(tp) if counter=1 then Log(v.Text) end if counter = counter+1 Next
jmon Well-Known Member Licensed User Longtime User Jul 16, 2019 #5 ykucuk said: how to access Pane in the second Tab Page Click to expand... Hi, you can do it like that, Like DonManFred said: Code: Copy Dim count As Int = 0 For Each p As TabPage In tp.Tabs If count = 1 Then Dim btn As Button btn.Initialize("") btn.Text = $"Button added to page 2!"$ p.Content.AddNode(btn, 50, 50, 200, 100) End If count = count + 1 Next tp.SelectedIndex = 1 Here that creates a button on the second page (page index 1, because the first page is index 0). So the pane of the TabPage is accessed via "p.Content". By the way, I don't know why I went as far as using JavaObject in the first example, but to access the tabs, just use: Code: Copy tp.Tabs Instead of the code I wrote above Upvote 0
ykucuk said: how to access Pane in the second Tab Page Click to expand... Hi, you can do it like that, Like DonManFred said: Code: Copy Dim count As Int = 0 For Each p As TabPage In tp.Tabs If count = 1 Then Dim btn As Button btn.Initialize("") btn.Text = $"Button added to page 2!"$ p.Content.AddNode(btn, 50, 50, 200, 100) End If count = count + 1 Next tp.SelectedIndex = 1 Here that creates a button on the second page (page index 1, because the first page is index 0). So the pane of the TabPage is accessed via "p.Content". By the way, I don't know why I went as far as using JavaObject in the first example, but to access the tabs, just use: Code: Copy tp.Tabs Instead of the code I wrote above