Built-In Caption
SftMask/OCX provides an easy to use built-in caption which is displayed at a user-definable position, relative to the edit control (see Caption.Position). The alignment of the caption can be defined both horizontally and vertically (using Caption.Alignment and Caption.VerticalAlignment). The text of the caption is defined using the Caption.Text property. The caption can be defined as transparent (using Caption.Transparent), so the background of the enclosing form or dialog is used as background for the caption's text.
The caption can include an accelerator key. By using the & character in the Caption.Text property, the following character becomes an accelerator key. If the user types Alt plus the defined accelerator key, the Masked Edit control receives the input focus. For example, if the Caption.Text property is set to "Today's &Date", the displayed caption will read "Today's Date", i.e., the D is underlined. If the user types Alt+d, the Masked Edit control receives the input focus. To display an & character use "&&".
The caption can be hidden by setting the Caption.SizePercent and the Caption.Width properties to 0.
The size of the caption depends on the position of the caption as defined using the Caption.Position property and the AutoSize and Caption.SizePercent properties:
Position | AutoSize | SizePercent | Description |
---|
0 - positionSftMaskLeft | False | 0-100 | The caption width is defined by the Caption.SizePercent or Caption.Width properties. The width of the caption is the specified percentage of the overall control width. The edit control is displayed in the remaining area to the right of the caption. The height of the caption and the edit control is equivalent to the overall height of the control, as defined at design-time. |
| True | 0-100 | The caption width is defined by the Caption.SizePercent or Caption.Width properties. The width of the caption is the specified percentage of the overall control width. The edit control is displayed in the remaining area to the right of the caption. The height of the caption and the edit control is automatically determined based on the attributes of the caption and edit control, such as the Caption.Font and the control's Font property. |
2 - positionSftMaskRight | False | 0-100 | The caption width is defined by the Caption.SizePercent or Caption.Width properties. The width of the caption is the specified percentage of the overall control width. The edit control is displayed in the remaining area to the left of the caption. The height of the caption and the edit control is equivalent to the overall height of the control, as defined at design-time. |
| True | 0-100 | The caption width is defined by the Caption.SizePercent or Caption.Width properties. The width of the caption is the specified percentage of the overall control width. The edit control is displayed in the remaining area to the left of the caption. The height of the caption and the edit control is automatically determined based on the attributes of the caption and edit control, such as the Caption.Font and the control's Font property. |
1 - positionSftMaskTop | False | 0-100 | The caption height is defined by the Caption.SizePercent or Caption.Width properties. The height of the caption is the specified percentage of the overall control height. The edit control is displayed in the remaining area below the caption. The height of the edit control is automatically determined based on the attributes of the edit control, such as the control's Font property. The width of the caption and the edit control is equivalent to the overall width of the control, as defined at design-time. |
| True | 0-100 | The Caption.SizePercent or Caption.Width properties are ignored. The edit control is displayed below the caption. The height of the caption and the edit control is automatically determined based on the attributes of the caption and edit control, such as the Caption.Font and the control's Font property. The width of the caption and the edit control is equivalent to the overall width of the control, as defined at design-time. |
3 - positionSftMaskBottom | False | 0-100 | The caption height is defined by the Caption.SizePercent or Caption.Width properties. The height of the caption is the specified percentage of the overall control height. The edit control is displayed in the remaining area below the caption. The height of the edit control is automatically determined based on the attributes of the edit control, such as the control's Font property. The width of the caption and the edit control is equivalent to the overall width of the control, as defined at design-time. |
| True | 0-100 | The Caption.SizePercent or Caption.Width properties are ignored. The edit control is displayed above the caption. The height of the caption and the edit control is automatically determined based on the attributes of the caption and edit control, such as the Caption.Font and the control's Font property. The width of the caption and the edit control is equivalent to the overall width of the control, as defined at design-time. |