Version

Working With Tabs

This topic covers the various ways that you can manipulate tabs, including adding, removing, disabling, hiding and ordering tabs. Formatting the appearance of tabs is covered in the separate Layout and Appearance of WinTab and WinTabStrip overview topic.

Tabs can be added in the following ways:

  • At design-time the 'Add Tab' verb in the context menu, will add a new tab.

  • Also at design-time tabs can be added with the collection editor for the element’s Tabs collection.

  • At run-time call the Add method off the Tabs collection to add a tab. Use either the overload that takes a single string parameter which initializes the tab’s Key property or the overload that takes two strings, one for the Key and one for the Text .

Tabs can be removed in the following ways:

  • At design-time the 'Remove Tab' verb in the context menu, will remove the currently selected tab.

  • Also at design-time, tabs can be removed with the collection editor for the element’s Tabs collection.

  • At run-time call the Remove , RemoveAt and Clear methods of the Tabs collection to remove tabs. These methods remove the current tab, a specified tab, or all tabs, respectively.

Tabs can be ordered/repositioned in the following ways:

  • At design-time tabs can be dragged to a new relative location.

  • Also at design-time tabs can be repositioned with the collection editor for the element’s Tabs property.

  • At run-time call the UltraTab object’s Reposition method or set its VisibleIndex property.

  • Also at run-time tabs can be dragged by the user if the AllowTabMoving property is set to true. The customized tab order can be easily persisted between sessions using the SaveTabOrderAsBinary , SaveTabOrderAsXml , LoadTabOrderFromBinary and LoadTabOrderFromXml methods.

  • At design-time all tabs are visible and enabled. Setting an UltraTab object’s Visible property to false will hide the tab at run-time. Setting an UltraTab object’s Enabled property to false will disable the tab at run-time.