Advertisement
6_2008-2009 VB function enhancement #215220

MSFlexGrid Column resizer

Hey guys out there, I make this function as i was seeking some good and easy way to make my FlexGrid look better.......I have not copied it, but if any other did the same then do tell me i will try to modify it....... and please feel free to use it and kindely also vote for me........Thanks

AI

Shrnutí AI: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.

Zdrojový kód
original-source
Public Function AlignGridData(FlexGrid As MSFlexGrid)
'THIS FUNCTION IS USED FOR MAKING ENOUGH SPACE FOR TEXT SO THAT THE
'TEXT HAVING MAXIMUM WIDHT CAN BE EASILY BE READ IN FLEXGRID
  Dim ObjFrm As Form
  Dim MaxCol As String
  Dim J, I As Integer
  For J = 1 To FlexGrid.Cols - 1
    MaxCol = ""
    For I = 0 To FlexGrid.Rows - 2
     If I = 0 Then
       FlexGrid.Row = 0
       FlexGrid.Col = J
'       FlexGrid.CellFontBold = True
     End If
     If FlexGrid.Parent.TextWidth(FlexGrid.TextMatrix(I, J)) > FlexGrid.Parent.TextWidth(MaxCol) Then MaxCol = FlexGrid.TextMatrix(I, J)
    Next I
    FlexGrid.ColWidth(J) = FlexGrid.Parent.TextWidth(MaxCol) * 1.6
  Next J
 End Function
Původní komentáře (3)
Obnoveno z Wayback Machine