Sets the colors and style used to draw selected cells.

Usage

Set_Property(OLECtrlEntID, "OLE.SelectionStyle", Array)

Values

Array has the following structure:

PosNameTypeDescriptionDefault
<1>Selected Cell   
<1, 1>Cell Foreground ColorColorThe selected cell's text colorNone
<1, 2>Cell Background ColorColor FillThe selected cell's background colorNone
<1, 3>Cell FontFontThe selected cell's fontNone
<2>Selected Record   
<2, 1>Record Foreground ColorColorThe selected record's text colorNone
<2, 2>Record Background ColorColor FillThe selected record's background colorNone
<2, 3>Record FontFontThe selected record's fontNone
<3>Selected Column   
<3, 1>Column Foreground ColorColorThe selected column's text colorNone
<3, 2>Column Background ColorColor FillThe selected column's background colorNone
<3, 3>Column FontFontThe selected column's fontNone
<4>Selected Cell Border ColorColorThe color of the selected cell's borderAuto
<5>Selected Cell Border SizeIntegerThe thickness, in pixels, of the selected cell's border2
<6>Headers Pressed on SelectOptionEstablishes whether or not header cells depress along the same record or column of the selected cellBoth
<7>Select by HeadersOptionEstablishes whether or not records or columns can be selected by clicking on the a column or record headerNone
<8>Show Selection AlwaysBooleanEstablishes whether or not the selection appears even if the table does not have focus0
<9>Adjust EditLine By PaddingBooleanEstablishes whether or not the cell's embedded editline should take cell padding into account0

Remarks

The SelectionStyle property sets the style used by the EditTable to show selected cells, columns, and records. Colors in this property override colors set by the AutoColors and CellColors properties.

This is most often a one time property. It provides an easy way to establish an overall look and feel to the table that the OI Edit Table cannot easily acheive. The colors and fonts in this property override all other color settings, so selected cells remain consistent thoughout the entire table.

Selection Colors and Fonts

The first 3 fields establish the colors and fonts used to render the selected cell, record, and column respectively. This means you can have the selected row be a different color than the selected cell, providing visual feedback to the user as to their overall location. You can even have all three fields set to create a kind of crosshair appearance, leading the user directly to the selected cell. If you don't want a cell, record, or column to change colors when selected, then set the color values to "None." This will cause the edit table to use the color settings established in the CellColors or AutoColors properties.

Selected Cell's Border

The OI Edit Table only has a hard-to-see dotted line just inside the selected cell. The SRP Edit Table draws a solid border around the selected cell. Field 4 allows you to set that border's color, or you can set it to "None" to use no border. Field 5 lets you set the border's thickness. By default, it's two pixels wide, but you can set it to 3, 4, or 10. Just keep in mind that a thick border obscures other cells and just looks silly.

Header Cell Behavior

When a cell is selected, you can specify how the header cell's above it and to its right behave by changing the value of field 6. By default, both the column header and record header appear depressed, but you can remove this bahavior on either the column the record or both. Just set field 6 to "None" (no depressed header cells), "Column" (only depress column headers), "Record" (only depress record headers), or "Both" (depress both column and record headers).

You can also establish whether or not records and columns are selected when the user clicks on a column header or record header. Set field 7 to "None" (never select records or columns), "Column" (select only columns via column headers), "Record" (select only records via record headers), or "Both" (select both columns and records via their respective headers). Note that the entire column or record is not selected. Instead, the selected cell moves to the record or column whose header was clicked. At all times, their is only one selected cell.

Show Selection Always

By default, the selection colors are not used when the table loses focus. This helps the user be more aware of which table they are currently in. However, if you want the user to see the selection at all times, set this flag to true. Doing so will show the selection colors regardless if the table has focus or not.

Adjust EditLine By Padding

When a cell goes into edit mode, an embedded editline is placed over the cell so the user can modify its contents. By default, this edit line always fills up the entire area of the cell. By setting this field to 1, you can force the editline to take CellPadding into account. In this case, the editline will be compressed to fit within the margins defined by that cell's padding. This is useful, for instance, if you do not want to obscure a cell's prompt during edit mode.

See Also

AutoColorsCellColorsSelPos

  • No labels