有个MSFlexGrid控件,由于数据库字段太长被挡住了一部分,上网找到了可以自动调整的函数,请问该如何调用呢?谢谢!!
是在From_Load中么?已有MSFlexGrid控件名称为grdDr1  Public Sub adjustcolwidth(frmcur As Form, gridcur As Object, Optional bnullrow As Boolean = True, Optional dblincwidth As Double = 0)
  '--------------------------------------------------------------------
  '功能:自动调整grid各列列宽为最合适的宽度
  '参数:[frmcur]........................................当前工作窗体
  '     [gridcur]......................................当前要调整的grid
  '--------------------------------------------------------------------
  Dim i, j       As Integer
  Dim dblwidth     As Double
          With gridcur
                  For i = 0 To .Cols - 1
                          dblwidth = 0
                          If .ColWidth(i) <> 0 Then
                                  For j = 0 To .Rows - 1
                                          If frmcur.TextWidth(.TextMatrix(j, i)) > dblwidth Then
                                                  dblwidth = frmcur.TextWidth(.TextMatrix(j, i))
                                          End If
                                  Next
                                  .ColWidth(i) = dblwidth + dblincwidth + 100
                          End If
                  Next
          End With
            
  End Sub