HeaderPane
Main
Hide

SftMask/DLL 7.0 - Masked Edit Control

Share Link
Print

Display Attributes

Various fields of the SFTMASK_CONTROL structure are available to define the visual appearance of the masked edit control:

iAlignmentThe horizontal alignment of the contents (ES_LEFT, ES_CENTER, ES_RIGHT). While the control has the input focus, left and right aligned text display is possible. While the control does not have the input focus, left, centered or right aligned text is possible. The lpszFormattedText field can be used to override the default contents while the control does not have the input focus.
fAutoSizeControls the height of the control. By setting fAutoSize to TRUE, the control's height is automatically adjusted so text is never clipped vertically. The height of the control is increased or decreased as necessary based on the size of the font used (defined using the WM_SETFONT message and the captionFont field).
iBorderStyleDefines the border style of the control (see SFTMASK_BORDER Constants).
lpszCaption and caption* fieldsDescribe the attributes of the control's caption area (see Built-In Caption).
fDDButtonVScrollWidthDefines whether the drop down button uses the width of a vertical scrollbar.
iEditStyleDefines whether up/down buttons, a calendar drop down button or an ellipse button is displayed (see SFTMASK_EDIT Constants).
FontThe font used to display the contents of the control is defined using the WM_SETFONT message. Modifiable fields can optionally be underlined using the fPromptUnderline field. The height of the control may automatically be adjusted when the font changes, based on the fAutoSize field.
lpszFormattedTextThis optional field can be used to display text when the masked edit control does not have the input focus, overriding the (default) formatted contents of the control.
fHideSelectionDefines the display of the currently selected text when the control does not have the input focus.
fHotTrackDefines whether up/down, drop down and ellipse buttons are hot-tracked.
lpszLabel, iLabelPositionDefine a label displayed inside the edit area (see Label).
chPromptCharModifiable fields can display the prompt character in places where data has not yet been entered. The default is a space character. The fPromptUnderline field can be used to underline input fields. The fPromptUnderline field should be used instead of defining chPromptChar as an underscore ("_") character.
fPromptUnderline, fPromptUnderlineNoFocusThese fields can be used to underline areas where data has not been entered, with and without the input focus.
chPswdCharIf data entered should not be displayed (e.g. in password fields), the chPswdChar field can be used to define the character that should be displayed instead of actual data. The chPswdChar field only takes effect if the "<p" subtoken is used in a mask or if no mask has been defined (see Edit Masks).
iUseThemesDefines whether Windows themes are used (see Using Themes).
nDarkModeDefines whether the control participates in Windows dark mode (see Dark Mode).
nHighContrastModeDefines whether the control honors the Windows High Contrast setting (see High Contrast).
Colors
colorBgDefines the background color of the control. Text that is selected (highlighted) uses the background color defined using colorSelectBg.
colorBgInvalidDefines the background color of the control, which is used when the control's contents are invalid.
colorBgFocusDefines the control's background color while it has the input focus.
colorFgDefines the foreground color used to display text and fields modifiable by the user, provided the control is enabled. Literals defined using the edit mask use the color defined using colorMaskFg. Text that is selected (highlighted) uses the foreground color defined using colorSelectFg. If the control is disabled, the color defined using colorFgGrayed is used instead.
colorFgInvalidDefines the foreground color used to display text and fields modifiable by the user. This color is only used when the control's contents are invalid.
colorFgFocusDefines the control's default text color while it has the input focus.
colorFgGrayedDefines the foreground color used to display text and fields modifiable by the user, provided the control is disabled. Literals defined using the edit mask use the color defined using colorMaskFgGrayed. If the control is enabled, the color defined using colorFg is used instead.
colorMaskFgDefines the foreground color used to display text not modifiable by the user (literals), provided the control is enabled. Text that is selected (highlighted) uses the foreground color defined using colorSelectFg. If the control is disabled, the color defined using colorMaskFgGrayed is used instead.
colorMaskFgGrayedDefines the foreground color used to display text not modifiable by the user (literals), provided the control is disabled. If the control is enabled, the color defined using colorMaskFg is used instead.
colorSelectBgDefines the background color of text that is selected (highlighted).
colorSelectBgFocusDefines the control's background color for selected text while it has the input focus.
colorSelectFgDefines the foreground color used to display text that is selected (highlighted).
colorSelectFgFocusDefines the control's selected text color while it has the input focus.
captionColorBg, captionColorFg, captionColorFgGrayedDefine the caption area colors (see Built-In Caption).
calcColor* fieldsDefine the popup calculator colors (see Popup Calculator).
calendarColor* fieldsDefine the popup calendar colors (see Popup Calendar).

All color fields accept an RGB value or SFTMASK_NOCOLOR to use the applicable default color. System color values (COLOR_* | 0x80000000L) can also be used, which resolve to the current system colors, including the user's high contrast palette when high contrast is active.

See Also Built-In Caption | Label | Using Themes | Dark Mode | High Contrast | SFTMASK_CONTROL


Last Updated 08/30/2026 - (email)
© 2026 Softel vdm, Inc.