Microsoft KB Archive/10426

Borders Around and Icons in Dialog Boxes

PSS ID Number: Q10426 Article last modified on 11-05-1993

2.00 3.00 MS-DOS

= QUESION =

How do you adjust for the proper placement of an icon in a dialog box? How do you get attractive borders on dialog boxes?

= RESPONSE =

To create a dialog box with attractive borders, use the STYLE keyword in your dialog template as follows:

mydialog DIALOG 10, 10, 100, 50 STYLE WS_DLGFRAME | WS_POPUP | WS_VISIBLE BEGIN … END

To include an icon in your dialog box, use something similar to the following in your dialog template:

CONTROL “ResourceName”, id, STATIC, SS_ICON, x, y, 0, 0

where id is the control ID, and x and y are the horizontal and vertical positions of the top left corner of the icon. Note that the last two parameters are ignored since the icon automatically sizes itself to the appropriate size. “ResourceName” is the resource name of the icon resource, which must be in the same resource file as the dialog template.

Additional reference words: 2.00 3.00 KBCategory: KBSubcategory: UsrDlgsRare/misc Copyright Microsoft Corporation 1993.