Help Center

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.

Windowspropertydoc-orphan
No implementation located. This member is documented, but the source scan found no matching declaration. It is likely declared in a header this scan does not resolve, or provided by a macro.

Syntax

PROPERTY FillStyle () AS FillStyleSettings
PROPERTY FillStyle (BYVAL style AS FillStyleSettings)

Parameters

NameDescription
styleOne 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