Change Fonts in a MSHFlexGrid at RunTime

sethindeed
10-04-2001, 12:21 PM
Hello,
I tried to change the font of one particular row ( the first one, fixed one ). I can easily do it in a normal MSFlexGrid ( using CellFont ) but with the HGrid, nothing seems to work. Tried MSFlexGrid.FontFixed and it applies to all the grid, then I try with FontHeader, and it says that it is missing an argument...
Anybody has a clue ?
Thanx

sethindeed
10-04-2001, 01:08 PM
Nevermind.
I found out.

WHM
10-04-2001, 01:46 PM
I am not an expert on the MSHFlexgrid, in fact, I have not used it yet at all, but, like you, I have used the MSFlexGrid a fair amount. I played with the MSHFlexGrid a bit to try to see if I could figure out how to change the cellfontsize, and here is what I did to make it work:

Option Explicit

Private Sub Form_Load()
Grid.TextMatrix(0, 0) = "Col 1"
Grid.TextMatrix(0, 1) = "Col 2"
Grid.TextMatrix(0, 2) = "Col 3"
Grid.TextMatrix(0, 3) = "Col 4"

Grid.TextMatrix(1, 0) = "Data 1"
Grid.TextMatrix(1, 1) = "Data 2"
Grid.TextMatrix(1, 2) = "Data 3"
Grid.TextMatrix(1, 3) = "Data 4"

End Sub

Private Sub Grid_Click()

If Grid.MouseRow = 0 Then
Grid.FixedRows = 0
Grid.ColSel = Grid.MouseCol
Grid.RowSel = 0
Grid.CellFontSize = 10
Grid.FixedRows = 1
End If
End Sub

Create a form and place a MSHFlexGrid on it and rename it "Grid". Paste this code to the form and try it. It is a bit messy, but it workds. There maybe other ways to do it.

Hunter

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum