MSHF Flexible Grid

pardeep3dec's Avatar, Join Date: Aug 2008
Newbie Member
Hi Friends,
I am using flexible grid for showing recordset . My problem is that when text length goes greater than flexible grid cell/grid then it not adjusted according to text.

Please help. I set word wrap property True but it is not work.
telkomek's Avatar, Join Date: Oct 2010
Light Poster
Public Function AutoFitFlexGrid(ByVal flx As MSHFlexGrid, frm As Form)
Dim r As Long
Dim C As Long
Dim cell_wid As Single
Dim col_wid As Single

    For C = 0 To flx.Cols - 1
        col_wid = 0
        For r = 0 To flx.Rows - 1
            cell_wid = frm.TextWidth(flx.TextMatrix(r, C))
            If col_wid < cell_wid Then col_wid = cell_wid
        Next r
        flx.ColWidth(C) = col_wid + 150
    Next C
End Function
may help your problem...