FillStyleproperty
Returns or sets a value that determines whether setting the Text property, or one of the cell formatting properties, applies the change to all selected cells within the MSHFlexGrid.
Syntax
PROPERTY FillStyle () AS FillStyleSettings
PROPERTY FillStyle (BYVAL style AS FillStyleSettings)
Parameters
| Name | Description | |
|---|---|---|
style | One of the constants listed below. |
Description
Returns or sets a value that determines whether setting the Text property, or one of the cell formatting properties, applies the change to all selected cells within the MSHFlexGrid.
Remarks
The primary use of flexFillRepeat is to avoid slow loops when applying identical formatting to a large group of cells. Instead of iterating through every cell in a row or column, you can select the range and apply the property once.
Examples
grid.Redraw = False ' Boost performance grid.FillStyle = flexFillRepeat grid.Row = 1 ' Start of selection grid.Col = 0 grid.RowSel = 1 ' End of selection grid.ColSel = .Cols - 1 grid.CellBackColor = vbGreen ' Applies to the whole selection grid.FillStyle = flexFillSingle ' Reset to default grid.Redraw = True
To quickly color an entire row green without a loop: Important limitations
Discontinuous selection: The property does not work across discontinuous selections (like those made with flexSelectionListBox). Only the selection block containing the current active cell will be modified.
Active cell focus: When using flexFillRepeat, you must always ensure the Row, Col, RowSel, and ColSel properties are correctly defined to cover the intended range before applying the formatting change.
Reference
- Documented in Windows/Windows GUI/MSHFlexGrid Class.md
- Topic: Microsoft Hierarchical Grid