Hide

SftTabs/OCX 6.5 - Tab Control for VB6

Display
Print

Tabs and Associated Controls

SftTabs/OCX offers two distinct methods to manage controls associated with a tab:

Tab Controls With Client Area

Based on the presence of a client area, controls can be added to the tab's client area at design-time. The client area is used to display controls associated with each tab. During design-time and at run-time, switching between tabs exposes the associated controls. As the user switches between tabs, the controls associated with each tab are shown or hidden. As controls are hidden because their associated tab is not the current tab, the controls are not only hidden, but also disabled (using Visual Basic's Enabled property). This is fully automatic and requires no application intervention.

The PropSheet sample shows how a tab control is used to contain associated controls.

The application receives a Switching and Switched event as the currently active tab changes. The Switching event allows an application to prevent the change to the new current tab.

The tab order of the controls contained within the client area (or current tab page) is defined using Visual Basic's TabIndex property.

Tab Controls Without Client Area

If a client area is not present, SftTabs/OCX does not maintain associated controls. The tab control can then be used (under application control) to cause some sort of data switching or to activate other objects, such as forms or controls.

The included MDITab sample demonstrates how a tab control can be used to switch between MDI child windows of an MDI application.

The Tab.Tag1 (and Tab.Tag2) property is particularly useful in this context, as it allows an application to store a reference to an object, usually a form, with each tab. This provides easy access to and management of objects that are controlled by the application in response to events generated by the tab control.

The application receives a Switching and Switched event as the currently active tab changes. The Switching event allows an application to prevent the change to the new current tab.


Last Updated 08/13/2020 - (email)
© 2024 Softel vdm, Inc.