PBUS
Helping Developers Modernize their Applications

Tab Control

The Tab Control should be used as a direct replacement for the tab control that is native to PowerBuilder.
Using this control can give your application an immediate face-lift. The tab control can be customized in a number of different ways:

  • Allow users to move tabs around to change the order.
  • Dynamically close all or one tab.
  • Display a close button at the end of the tab strip, in the currently selected tab, in all tabs or not at all.
  • Allow users to navigate tabs with scroll arrows or with a drop down arrow.
  • Dynamically enable, disable, hide or show any tab.
  • Open PB userobjects or windows within the tab control.
  • Display images and text in each tab.
  • Change tab text color.
  • There are many styles to choose from, the most popular being the VS2005 style.

tab controls


Implementation

//Open Event of window that contains the tab control tab control
//Or the post constructor event of the userobject that contains the tab control
//Add images to the tab controls image array
//The first call creates element 1, the second element 2 and so on

uo_tabcontrol.of_AddImage('SQL!')
uo_tabcontrol.of_AddImage('StaticText!')
uo_tabcontrol.of_AddImage('ArrangeIcons!')

//Open userobject as tabtab control
uo_tabcontrol.of_OpenTab(iuo_1, 'Toolbarstrip', 1)
uo_tabcontrol.of_OpenTab(iuo_3, 'Shortcutbar', 2)
uo_tabcontrol.of_OpenTab(iuo_4, 'Buttonlistbar', 3)

//Select the first tab
uo_tabcontrol.of_SelectTab(1)

//Set the tab style to VS2005 uo_tabcontrol.of_SetStyle(uo_tabcontrol.VS2005)