1. We have moved from vBulletin to XenForo and you are viewing the site in the middle of the move. Though the functional aspect of everything is working fine, we are still working on other changes including the new design on Xenforo.
    Dismiss Notice

MSHF Flexible Grid

Discussion in 'Visual Basic ( VB )' started by pardeep3dec, Aug 26, 2008.

  1. pardeep3dec

    pardeep3dec New 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.
     
  2. telkomek

    telkomek New Member

    Code:
    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...
     

Share This Page