cancel
Showing results for 
Search instead for 
Did you mean: 

How to get active page tag name in a variable in cb_1 clicked event

Former Member
0 Kudos

I have a tabpages like    tab_1.tabpage_1 ,tab_1.tabpage_2,tab_1.tabpage_3

how to get active tabpage  tag in a command button of the form .

Please  help.

Many Thanks

Pol

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Polachan;

   PB does not have a method to give you this information at run time. I just added this functionality to my new STD Integrated Framework version that will be released soon.

  What you need to do in your PB application is keep track of the active Tab Page in the SelectionChanged event of the TabControl. In there you need to map the "Index" argument given in this event to the Tab Control's "Control" array to get the object pointer.

HTH

Regards ... Chris

Answers (3)

Answers (3)

Former Member
0 Kudos

Similar to Chris pseudo-code:


dragobject ldo_tabpage

ldo_tabpage = tab_1.control[tab_1.selectedtab]

MessageBox('Tag',ldo_tabpage.tag)

That would give you the tag of the currently active tabpage.

Former Member
0 Kudos

If the button is on the page itself, then the parent of the button is the page. So:

string ls_name = parent.classname( )

If you need the name of the tab, simply follow the same logic - the parent of the page is the tab control itself.

Former Member
0 Kudos

Could you use the SelectedTab property of the tab control?

Former Member
0 Kudos

Hi Ken;

  Yes, that would work as well ... for example:

vc_tp_master   lo_tp

lo_tp =    THIS.Control [THIS.Selectedtab]

if IsValid (lo_tp) = TRUE THEN

   MessageBox ("FYI", lo_tp.ClassName ( ) )

END IF

HTH

Regards ... Chris