Hello,
How can I get the name of a TabPage active.
if i in the TabPage = 2 the name is Page 2, TabPage = 4, name is Page 4.
I have this
index = tabMainTab.tab(); this is #2 Name: Page2
and in the caption all the time give me Page1.
I have this:
FormTabPageControl FTPC ;
;
super();
index = tabMainTab.tab() // 2
name = FTPC.caption(); // Page 2 but all the time is Page 1
Somebody know how i can do that?
Thanks in avance.
*This post is locked for comments
Anywhere in the form where you need the information (the name of the active tab page).
Hi, where to write above two line of code, I mean on which method override ?
If your question is now answered, please close the thread by marking the verified answer(s). It will make clear that the thread doesn't need attention anymore, and people with the same question will easily locate the answer.
Notice "Did this answer your question?" beside each reply.
Ok, thank you for the explanation.
You can get the active tab page by calling tabMainTab.getActivePage():
FormTabPageControl activeTabPage = tabMainTab.getActivePage(); activeTabPage.caption();
I don't believe that your code works. You never set the value of FTPC variable, therefore FTPC.caption() should fail, because you're trying to call a method on a null reference.
I took the liberty to change your title from FormTabControl to a more descriptive Name of active tab page. I also changed the category from Other to Development / Customization / SDK and replaced the sentence you used as a tag (Name of TabPage active.) with something more suitable for categorization (tab page).
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,228 Super User 2024 Season 2
Martin Dráb 230,056 Most Valuable Professional
nmaenpaa 101,156