Resize the columns stringgrid in delphi -
i want stringgrid. change size of columns.
this stringgrid connected database. however, tried different methods; column did not change. should do?
not sure mean "lengths", i.e. widths or heights.
this code change lefthand column's width:
procedure tform1.button1click(sender: tobject); begin sg1.colwidths[0] := sg1.colwidths[0] + 10; end;
this link show how "autosize" grid's column widths:
how make stringgrid's columns fit grid's width?
in case meant heights of cells, can row @ time this:
procedure tform1.btnheightclick(sender: tobject); begin sg1.rowheights[1] := sg1.rowheights[1] + 10; // nb row 0 column header end;
or, can set height of rows @ once this:
procedure tform1.btnheightsclick(sender: tobject); begin sg1.defaultrowheight := sg1.defaultrowheight + 10; end;
Comments
Post a Comment