Specifying Control Properties

In addition to specifying constraints, you can also specify control properties using dispatch identifiers — for example, the ASFC_DISPD_FONT property, followed by a Unicode string.

Note Explicitly terminate all strings.

The following code example shows how to specify the font property of a control.

   CONTROL "Elapsed:", IDC_CTRL_ELAPSED,"APC_Label:",
         ASFC_ALIGN_LEFT|ASFC_ALIGN_SINGLELINE
   BEGIN
      FA_LEFT_OF_FORM, FA_HORIZONTAL_CENTER
      // Set the font of the control.
      ASFC_DISPID_FONT, L"Tahoma-Bold-18\0"
   CONTROL         "",
      IDC_CTRL_TIME,"APC_Label",ASFC_ALIGN_LEFT|ASFC_ALIGN_SINGLELINE,
      0,0,0,0
   BEGIN
      FA_LEFT_TO_RIGHT_OF_CONTROL, IDC_CTRL_ENABLED
   END

Properties are applied before constraints, so in the code example, the label is sized correctly because the font size is specified before the constraints.

Also notice in the code example, the leading “L” indicates a Unicode string — as in C++ — and the explicit terminator. The format of the font string “Tahoma-Bold-18\0” is the font name “Tahoma,” followed by one or more modifiers, each of which begins with a hyphen. The following table shows valid modifiers.

Modifier
Description
Bold Indicates bold text.
Italic Indicates italic text.
Underline Indicates underline text.
Strikethrough Indicates strikethrough text.
Point size Sets the size of the text.

Note You can specify modifiers in any order, for example, “Tahoma-Bold-18” or “Tahoma-18-Bold.”