I'm maintaining a VB6 application that makes extensive use of the old VBAccelerator SGrid 2.0 (vbalGrid, using another Grid control isn't really an option). I need to change the grids font at run-time, and nothing I seem to do works to change the header font, only changing the grid controls Font property at design time seems to actually change the font.
Here is the code I've tried, which I would have thought would work:
Dim Fnt As New StdFont
Set Fnt = vbalGrid.Font
Fnt.Name = "MS Sans Serif"
Set vbalGrid.Font = Fnt
This sets the font for the body of the grid just fine, but you do have to clear and repopulate the grid if it already has data. However the header doesn't change, even if you clear all the columns and recreate them.
It looks like there is a bug in the
Property Set Fontroutine -- it does not callBuildMemDCto invalidate its buffered output DC.Try
RowHeight(1) = RowHeight(1) + 1or similar nudge to forceBuildMemDCgetting called. You'll have to increase the height of some row above its internalm_lMaxRowHeightvariable for the rebuild to kick in.