HeaderPane
Main
Hide

SftMask/DLL 7.0 - Masked Edit Control

Share Link
Print

Label

In addition to the built-in caption, SftMask/DLL can display a label inside the edit area, at its left or right end. The input area is reduced so entered text never overlaps the label. The label is typically used for a unit or currency symbol, such as "%" or "USD".

The label text is defined using the lpszLabel field of the SFTMASK_CONTROL structure. The special value "|" displays the currency symbol defined by the user's locale.

The label position is defined using the iLabelPosition field:

SFTMASK_LABELPOSITION_AUTOThe label is displayed at the left end of the edit area. If the label is the currency symbol ("|"), it is placed before or after the amount according to the locale's currency format convention. This is the default.
SFTMASK_LABELPOSITION_LEFTThe label is displayed at the left end of the edit area.
SFTMASK_LABELPOSITION_RIGHTThe label is displayed at the right end of the edit area.

The label is drawn using the control's font and follows the control's focus and invalid-contents foreground colors, as well as dark mode and high contrast rendering.

SFTMASK_CONTROL Ctl;
Ctl.cbSize = sizeof(SFTMASK_CONTROL);
SftMask_GetControlInfo(hwndCtl, &Ctl);
Ctl.iAlignment = ES_RIGHT;
Ctl.lpszMask = (LPTSTR) TEXT("$C-,8.2");
Ctl.lpszLabel = (LPTSTR) TEXT("|"); // locale currency symbol
Ctl.iLabelPosition = SFTMASK_LABELPOSITION_AUTO;
SftMask_SetControlInfo(hwndCtl, &Ctl);

See Also Built-In Caption | SFTMASK_LABELPOSITION Constants | SFTMASK_CONTROL


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