MSHF Flexible Grid

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

  1. pardeep3dec

    pardeep3dec New Member

    Joined:
    Aug 25, 2008
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    0
    Occupation:
    Software Developer
    Location:
    Delhi
    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

    Joined:
    Oct 11, 2010
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    0
    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

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice