ToolStrip as TabStrip


The following sample applications are included when you purchase the VB 2010 Tutorial Download Package or the VB 2010 "Extra" Sample Applications from The VB Programmer.


"Tab" controls in general are designed to conserve screen "real estate" by breaking up data to be displayed into logical "pages" (where each tab of the tab control represents a page). In classic VB (VB6 and earlier), there were two tab controls that were available: the “SSTab”, which was a “container” control, and operated similar to the TabControl in current versions of VB; and also the “TabStrip” control, which was NOT a container like the SSTab – so to use the TabStrip, you would have to control, in code, which items are shown or hidden when a particular tab is active. In VB.NET (VB 20XX), there is no equivalent of the legacy TabStrip control. However, this example puts a different “spin” on the ToolStrip control, using ToolStrip buttons as “tabs”.


The sample application uses a subset of the Customer table of the sample "Cust.mdb" database used in some of the other examples. Here, a “tab” (ToolStrip button) for each unique state is created dynamically at run-time. When a particular “tab” is clicked, the customers who reside in the corresponding state are displayed in the ListView.


The screen shots below show what will be displayed when NJ and PA, respectively, are clicked.