Sets the colors and style used to draw selected cells.
Usage
Set_Property(OLECtrlEntID, "OLE.SelectionStyle", Array)
Values
Array has the following structure:
Pos | Name | Type | Description | Default |
---|---|---|---|---|
<1> | Selected Cell | |||
<1, 1> | Cell Foreground Color | Color | The selected cell's text color | None |
<1, 2> | Cell Background Color | Color Fill | The selected cell's background color | None |
<1, 3> | Cell Font | Font | The selected cell's font | None |
<2> | Selected Record | |||
<2, 1> | Record Foreground Color | Color | The selected record's text color | None |
<2, 2> | Record Background Color | Color Fill | The selected record's background color | None |
<2, 3> | Record Font | Font | The selected record's font | None |
<3> | Selected Column | |||
<3, 1> | Column Foreground Color | Color | The selected column's text color | None |
<3, 2> | Column Background Color | Color Fill | The selected column's background color | None |
<3, 3> | Column Font | Font | The selected column's font | None |
<4> | Selected Cell Border Color | Color | The color of the selected cell's border | Auto |
<5> | Selected Cell Border Size | Integer | The thickness, in pixels, of the selected cell's border | 2 |
<6> | Headers Pressed on Select | Option | Establishes whether or not header cells depress along the same record or column of the selected cell | Both |
<7> | Select by Headers | Option | Establishes whether or not records or columns can be selected by clicking on the a column or record header | None |
<8> | Show Selection Always | Boolean | Establishes whether or not the selection appears even if the table does not have focus | 0 |
<9> | Adjust EditLine By Padding | Boolean | Establishes whether or not the cell's embedded editline should take cell padding into account | 0 |
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.