2025-11-27 16:46:48 +09:00

31 lines
3.4 KiB
Plaintext
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{\rtf1\ansi\deff0\deftab720{\fonttbl{\f0\fswiss MS Sans Serif;}{\f1\froman\fcharset2 Symbol;}{\f2\froman\fprq2 Times New Roman;}{\f3\froman Times New Roman;}}
{\colortbl\red0\green0\blue0;\red0\green0\blue128;}
\deflang1033\pard\plain\f2\fs36\cf1\b MaskedEdit Control
\par \plain\f2\fs20
\par \plain\f2\fs24\b What is it?
\par \plain\f2\fs20
\par This class provides an easy-to-use edit control that allow you to specify the format with which all entries will be made.\~ Without exception.
\par
\par \plain\f2\fs20\b Features
\par \plain\f2\fs20
\par The Masked Edit control provides restricted data input as well as formatted data output. This control supplies visual cues about the type of data being entered or displayed.
\par
\par The Masked Edit control generally behaves as a standard text box control with enhancements for optional masked input and formatted output. If you don't use an input mask, the Masked Edit control behaves much like a standard text box.
\par
\par If you define an input mask, each character position in the Masked Edit control maps to either a placeholder of a specified type or a literal character. Literal characters, or literals, can give visual cues about the type of data being used. For example, the parentheses surrounding the area code of a telephone number are literals: (206).
\par
\par If you attempt to enter a character that conflicts with the input mask, the control generates a ValidationError beep. We could throw an exception but I think this is too heavy. The input mask prevents you from entering invalid characters into the control. \~ When you define an input mask, the Masked Edit control behaves differently from the standard text box. The insertion point automatically skips over literals as you enter data or move the insertion point.
\par
\par When you insert or delete a character, all nonliteral characters to the right of the insertion point are shifted, as necessary. If shifting these characters leads to a validation error, the insertion or deletion is prevented, and a ValidationError beep is triggered.
\par
\par Suppose the Mask property is defined as "?###", and the current value of the Text property is "A12."\~ If you attempt to insert the letter "B" to the left of the letter "A," the "A" would shift to the right. Since the second value of the input mask requires a number, the letter "A" would cause the control to generate a ValidationError beep.
\par
\par The Masked Edit control also validates the parameter value of the SetInputText function the user passes at run time. If you use the SetInputText function so that it conflicts with the input mask, the function will return an errorcode.
\par
\par You may select text in the same way as for a standard text box control. When selected text is deleted, the control attempts to shift the remaining characters to the right of the selection. However, any remaining character that might cause a validation error during this shift is deleted, and no ValidationError beep is generated.
\par
\par Normally, when a selection in the Masked Edit control is copied onto the Clipboard, the entire selection, including literals, is transferred onto the Clipboard. You can use the SetClipMode function to define the behavior for transferring only user-entered data onto the Clipboard or not - literal characters that are part of the input mask are not copied.
\par \~
\par \pard\plain\f3\fs20
\par }