A caption to appear within the cell, separate from the cell's contents.
Usage
Set_Property(OLECtrlEntID, "OLE.CellPrompt[field; record]", Array)
Values
Array has the following structure:
Pos | Name | Type | Description | Default |
---|---|---|---|---|
<1> | Prompt | Text | The prompt caption | "" |
<2> | Font | Font | The font used to render the prompt | Tahoma, 8 pt., Italic |
<3> | Color | Color | The color used to render the prompt | GrayText |
<4> | Horizontal Alignment | Option | The horizontal alignment of the prompt within the cell | Left |
<5> | Vertical Alignment | Option | The vertical alignment of the prompt within the cell | Top |
<6> | Appear When Empty | Boolean | Indicates whether or not the prompt only appears when the cell is empty | 0 |
<7> | Appear When Selected | Option | Indicates how the prompt appears when the cell is selected | None |
Indices
Index | Description |
---|---|
field | Index to an existing field |
record | Index to an existing record |
Remarks
The CellPrompt property provides you with a way to prompt users for input. Think of cell prompts as labels built right into the cell. This multivalued property has the following fields:
Prompt
This is the actual text of the prompt. It will be displayed exactly as entered.
Font
The Font field allows you to customize the font used to render the prompt. Make it smaller, larger, bold, italic, etc. to meet your needs. This field uses the standard Font format.
Color
The Color field sets the color used to draw the prompt. This can be set to an valid Color value.
Horizontal Alignment
This field determines where the prompt should appear within the cell horizontally. Set this field to "Left", "Center", or "Right" to position the prompt on the left, horizontally centered, or on the right respectively.
Vertical Alignment
This field determines where the prompt should appear within the cell vertically. Set his field to "Top", "Center", or "Bottom" to position the prompt on the top, vertically centered, or on the bottom respectively.
Appear When Empty
This flag can be used to control when the prompt should appear. The prompt is always visible by default, but this could conflict with the cell's contents. By setting this flag to 1, you establish that the prompt should disappear when the cell has contents to display.
Appear When Selected
This flag can be used to control when the prompt should appear. The prompt is always visible by default, but if many cells use prompts, your table can begin to look cluttered. Use this field to limit when the prompt should appear. Set this field to "Row", "Col", "Both", or "None". Setting this field to "Row" will show the prompt only when the cell's row is selected. Setting this field to "Col" will show the prompt only when the cell's column is selected. Setting it to "Both" will show the prompt only when the cell itself is selected. The default setting is "None", which means the prompt will appear all the time for that cell.
Example
// Add a prompt that will appear in the top left corner of a field Prompt = "" Prompt<1> = "Name" Prompt<2> = "Arial":@SVM:7:@SVM:700:@SVM:0 ;// Smaller Bold Font Prompt<3> = "GrayText" ;// Lighten the prompt Prompt<7> = "Row" ;// Only appear when the row is selected Set_Property(@Window:".OLE_EDITTABLE", "OLE.CellPrompt[1;All]", Prompt)