Hide

SftTabs/DLL 6.5 - Tab Control

Display
Print

Creating a Dialog Resource

This section describes how to add a tab control to a dialog using Visual Studio.

Adding a Tab Control to a Dialog

To add a SftTabs/DLL control to a dialog, use the "Custom Control" toolbar button. Click on the button and then the dialog being designed to add a control.

Custom Control

Once a custom control has been added to a dialog, you can edit the control properties by using the View, Properties... menu command.

Properties

To define a SftTabs/DLL control, enter the class SftTabsControl65 in the edit field labeled Class. A window caption is not necessary, so the edit field marked Caption can be left blank.

SftTabs/DLL Control Styles

To enter a SftTabs/DLL window style in the User Control Properties dialog, use the following list to add the desired style values and enter the resulting hexadecimal value in the field marked Style. For detailed information, see Tab Control Styles.

StyleValueDescription
WS_BORDER0x00800000Draws a border around the control. The border is a dark line. Generally not useful for a tab control.
WS_CHILD0x40000000Creates a child window. Usually required.
WS_DISABLED0x08000000Creates a tab control that is initially disabled. A disabled tab control cannot receive input from the user.
WS_GROUP0x00020000Specifies the first control of a group of controls. All controls defined with the WS_GROUP style after the first control belong to the same group. The next control with the WS_GROUP style ends the group and starts the next group.
WS_TABSTOP0x00010000Specifies a control that can receive the keyboard focus when the user presses the TAB key. Pressing the TAB key changes the keyboard focus to the next control with the WS_TABSTOP style.
WS_VISIBLE0x10000000Creates a tab control that is initially visible. Usually required.

The tab control can be customized using run-time code, which can be created using the SftTabs/DLL Wizard application.

Designing a Tabbed Dialog

A tabbed dialog is designed just like a regular dialog. The only difference is the tab control, which is added to make it a tabbed dialog. The tab control has to be designed using the SftTabs/DLL Wizard application and the resulting source code can then be copied to your application.

A tab control used with a tabbed dialog must provide a client area or a frame window has to be defined when calling SftTabs_SetControlInfo or CSftTabsDialog::InitializeTabControl.

The size of the tab control's client area must be large enough to accommodate all pages. Differences in font sizes and display resolutions may cause problems if the client area is not large enough. A page will always be sized as large as the client area allows. To make tabbed dialog versus page size consistent, make sure to always specify the same font to be used for all dialogs.

Designing a Page

The size of the tab control's client area must be large enough to accommodate a page. Differences in font sizes and display resolutions may cause problems if the client area is not large enough. A page will always be sized as large as the client area allows.

A tab page is designed just like a regular dialog with a few minor restrictions. A page is always a modeless dialog which has a tabbed dialog as its parent window. For that reason, the window style of a page has to be defined as "Child". The dialog should be defined without frame, border or other decoration. A system menu and title bar may be defined so a dialog caption can be entered. The system menu, title bar and the dialog caption will be removed by SftTabs/DLL before the page is shown. The page's caption will be used as the dialog caption for the main, tabbed dialog. This offers an easy way to change the tabbed dialog's window title when switching between pages.

To make tabbed dialog versus page size consistent, make sure to always specify the same font to be used for all dialogs.

Test Mode

In the dialog test mode offered by Visual Studio, the SftTabs/DLL control will not be displayed. Instead, a gray box will show the location of the control. When using the tab key to test the tab stops, the simulated SftTabs/DLL control will not receive the input focus and appear not to have a tab stop defined.


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