Redrawfunction
Returns or sets a value that determines whether the MSHFlexGrid should be automatically redrawn after each change.
Parameters
| Name | Description | |
|---|---|---|
bRedraw | True (Default): The grid repaints immediately every time a cell value, color, or property changes. False: The grid stores changes in memory but does not update the screen until the property is set back to True. |
Description
Returns or sets a boolean toggle that determines whether the MSHFlexGrid should be automatically redrawn after each change.
Remarks
When Redraw is set to True during a large loop, the grid attempts to repaint for every single cell update. On modern high-resolution displays, this causes significant visual flickering and drastically slows down execution. By setting Redraw = False, you can increase data processing speed by 10x to 100x.
Examples
PROPERTTY Redraw () AS BOOLEAN PROPERTY Redraw (BYVAL bRedraw AS BOOLEAN)
' 1. Turn off repainting to boost speed and prevent flicker grid.Redraw = False
' 2. Perform bulk data operations (e.g., loading 5,000 rows) For i = 1 To 5000 grid.AddItem "Row " & STR(i) & CHR(9) & "Data " & STR(i) Next i
' 3. Turn repainting back on to show all changes at once grid.Redraw = True
' 4. (Optional) Force an immediate refresh grid.Refresh
Reference
- Documented in Windows/Windows GUI/MSHFlexGrid Class.md
- Topic: Microsoft Hierarchical Grid