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:

PosNameTypeDescriptionDefault
<1>PromptTextThe prompt caption""
<2>FontFontThe font used to render the promptTahoma, 8 pt., Italic
<3>ColorColorThe color used to render the promptGrayText
<4>Horizontal AlignmentOptionThe horizontal alignment of the prompt within the cellLeft
<5>Vertical AlignmentOptionThe vertical alignment of the prompt within the cellTop
<6>Appear When EmptyBooleanIndicates whether or not the prompt only appears when the cell is empty0
<7>Appear When SelectedOptionIndicates how the prompt appears when the cell is selectedNone

Indices

IndexDescription
fieldIndex to an existing field
recordIndex 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)
  • No labels