Description


The method allows you to automatically adjust the width of the columns.


As a rule, this method should be called in the event of the OnChange component.



You can specify the following values as a parameter:


bfCells - autosize width by cells contents.

bfBoth - autosize width by contents of cells and column titles.

bfHeader - autosize width by column headers.



Example


procedure Form1_TreeView1_OnChange (Sender: TObject);
begin
    Form1.TreeView1.BestFitColumns(bfBoth);
end;