The tabs in the control appear in the order that they occupy in the Tabs collection. Once the control has been populated with tabs, you can choose to sort the tabs alphabetically based on the text they are displaying.
This capability is available in both the WinTab™ and WinTabStrip™ controls, although it is typically more useful in the WinTabStrip control. With the WinTab control, the programmer can always determine the order in which Tabs are added (and therefore appear.) But with the WinTabStrip control, the text of the tabs may be populated from a data source, causing the tabs to appear in the order they are retrieved. By sorting the tabs after the WinTabStrip control is populated, you can present an easy-to-use, alphabetized interface to the user.
Both controls give you control over the direction of the sort. The WinTab control always sorts based on the Text property of the tab. In the WinTabStrip control, you can specify which field from the data source should be used as the basis for the sort by using the control’s SortMember property.
Use the following code to sort the tabs in the control.