SftPrintPreview/DLL 2.0

Creating a Dialog Resource with Visual C++

Softel vdm, Inc.

This section describes how to add a Print Preview control to a dialog using Visual C++ 6.0 and Visual Studio .NET.

Adding a Print Preview Control to a Dialog

To add a SftPrintPreview/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.

Visual C++ 6.0

Visual Studio .NET through Visual Studio 2008

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

Visual C++ 6.0

Visual Studio .NET through Visual Studio 2008

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

SftPrintPreview/DLL Control Styles

To enter a SftPrintPreview/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.   The Print Preview control does not offer any custom window styles, so only the standard window styles (such as WS_BORDER, WS_TABSTOP, etc.) are available.

 

Style

Value

Description

WS_BORDER

0x00800000

Draws a border around the control. The border is a dark line.

WS_CHILD

0x40000000

Creates a child window. Usually required.

WS_DISABLED

0x08000000

Creates a control that is initially disabled. A disabled control cannot receive input from the user.

WS_GROUP

0x00020000

Specifies 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_TABSTOP

0x00010000

Specifies 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_VISIBLE

0x10000000

Creates a control that is initially visible. Usually required.

The control can be customized using run-time code, mainly using the SetControlInfo function.

Test Mode

In the dialog test mode offered by Visual C++, the SftPrintPreview/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 SftPrintPreview/DLL control will not receive the input focus and appear not to have a tab stop defined.


Feedback / comments / error reports for this topic
© 2016 - Softel vdm, Inc. - www.softelvdm.com