|
|
|
|
|
Dicas
|
|
Visual Basic (Grid/FlexGrid)
|
|
|
Título da Dica: Ajusta as colunas do MsFlexGrid para o tamanho do texto contido nas células
|
|
|
|
Postada em 1/8/2003 por Juninho
Private Sub CmdAjustar_Click()
Dim Max_Wid As Single Dim Wid As Single Dim Max_Row As Integer Dim R As Integer Dim C As Integer Screen.MousePointer = vbHourglass 'Ajusta as colunas do grid para o tamanho do texto contido nas celulas Max_Row = GRADE.Rows - 1 For C = 0 To GRADE.Cols - 1 Max_Wid = 0 For R = 0 To Max_Row Wid = TextWidth(GRADE.TextMatrix(R, C)) If Max_Wid < Wid Then Max_Wid = Wid Next R GRADE.ColWidth(C) = Max_Wid + 240 Next C Screen.MousePointer = vbDefault
End Sub
|
|
|
|
|