Opening, closing, and hiding tab pages

You can open tab pages in a script. You can close tab pages that you opened, but you cannot close tab pages that were inserted in the painter. You can hide any tab page.

This example opens a tab page of type tabpage_listbox and stores the object reference in an instance variable i_tabpage. The value 0 specifies that the tab page becomes the last page in the Tab control. You need to save the reference for closing the tab later.

This is the instance variable declaration for the tab page’s object reference:

userobject i_tabpage

This code opens the tab page:

li_rtn = tab_1.OpenTab &
   (i_tabpage, "tabpage_listbox", 0)

This statement closes the tab page:

tab_1.CloseTab(i_tabpage)