The control's prompt.
Usage
Set_Property(OLECtrlEntID, "OLE.Prompt[CtrlId]", Array)
Values
Array has the following structure:
Pos | Name | Type | Description | Default |
---|---|---|---|---|
<1> | Prompt Text | Text | The actual text used to prompt the user | "" |
<2> | Color | Color | The prompt's color | Auto |
<3> | Horizontal Alignment | Option | The prompt's horizontal alignment | Left |
<4> | Vertical Alignment | Option | The prompt's vertical alignment | Top |
<5> | Font | Font | The font used to display the font | 8 pt. Tahoma, Italic |
Indices
Index | Description |
---|---|
CtrlId | Identifies a subclassed control |
Remarks
Applies To: EDITLINE, EDITBOX
The Prompt property provides a unique way to prompt users for input or warn them of limitations or requirements. Essentially, a prompt is text that appears within the control only when the control is empty.
Here's an example that warns the user of a required field:
Once the user enters data, the prompt is gone:
Here's another example that tells the user of a limitation. This example shows of the multiline capabilites in an EDITBOX:
Each field is explained in detail below:
Prompt Text
This is the text that will appear when the control is empty. Multiple lines are supported--just use CRLF characters to delimit your lines.
Color
To make your prompt stand out, set the color as desired. For instance, you could use a red color to indicate a requirement or a gray color to indicate a hint. The default color is the system Gray Text color.
Horizontal Alignment
This field sets the horizontal alignment of the prompt when visible. Use "Left", "Center", or "Right" or just the first letter of each option.
Vertical Alignment
This sets the prompt's vertical alignment. Use "Top", "Center", or "Bottom" or just the first letter of each option.
Font
By default, the prompt is set to 8 pt. Italic Tahoma. Use this field to modify the font to suite your needs. Note that this font does not affect the control's font.
Example
// Set a password prompt Prompt = "" Prompt<1> = "Password Required " Prompt<2> = "RGB{255, 128, 128}" ;// A Light Red Prompt<3> = "Center" Prompt<4> = "Center" Prompt<5> = @SVM:@SVM:700 ;// Make it bold // Subclass the control (skip this if you've done it once already) CtrlId = @Window:".EDITLINE" Handle = Get_Property(CtrlId, "HANDLE") rv = Send_Message(@Window:".OLE_SUBCLASS", "OLE.Subclass", Handle, CtrlId) // Set the prompt (remember to use ; instead of .) Convert "." to ";" in CtrlId Set_Property(@Window:".OLE_SUBCLASS", "OLE.Prompt[":CtrlId:"]", Prompt)