The control's prompt.

Usage

Set_Property(OLECtrlEntID, "OLE.Prompt[CtrlId]", Array)

Values

Array has the following structure:

PosNameTypeDescriptionDefault
<1>Prompt TextTextThe actual text used to prompt the user""
<2>ColorColorThe prompt's colorAuto
<3>Horizontal AlignmentOptionThe prompt's horizontal alignmentLeft
<4>Vertical AlignmentOptionThe prompt's vertical alignmentTop
<5>FontFontThe font used to display the font8 pt. Tahoma, Italic

Indices

IndexDescription
CtrlIdIdentifies 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)
  • No labels