I have a stringgrid that contains text read from a file. The first row are column headings and I want to size the columns so the text fits. The following code creates columns that are about 10% too narrow - any idea how I can get it to fit?
ResultsGrid.Canvas.Font := ResultsGrid.Font;
for Col := 0 to ResultsGrid.ColCount - 1 do
ResultsGrid.ColWidths[col] :=
ResultsGrid.Canvas.TextWidth(ResultsGrid.Cells[Col, 0]);
Delphi XE3.
ResultsGrid.Canvas.Font := ResultsGrid.Font;
for Col := 0 to ResultsGrid.ColCount - 1 do
ResultsGrid.ColWidths[col] :=
ResultsGrid.Canvas.TextWidth(ResultsGrid.Cells[Col, 0]);
Delphi XE3.