小生愚昧,敢问如何把StringGrid第一列的宽度改小一些?它的初始值很大,占了很多空间。
而其它列都可以用鼠标改的。谢谢!

解决方案 »

  1.   

    无此属性:
    StringGrid1.Cols[0].Width
      

  2.   

    elphi syntax:property ColWidths[Index: Longint]: Integer;C++ syntax:__property int ColWidths[int Index] = {read=GetColWidths, write=SetColWidths};DescriptionRead ColWidths to determine the width of the cells in the column specified by the Index parameter. An index of 0 refers to the first column. Set ColWidths at runtime to change the width of an individual column. If the width of a column has not been set explicitly by resizing with the mouse, or by using the ColWidths property, its width is DefaultColWidth.Use the ColCount property to determine the number of entries in the ColWidths array.
      

  3.   

    StringGrid1.ColWidths[0] := 200;