6

I want to make my columns in a VirtualStringTree to have the same indentation on the left and on the right side of the content when auto sizing a column.

Take a look at my sample VST with Header Option hoDblClickResize turned on.

VST sample image

In this picture I doubleclicked the column header to auto resize the "Time" column. I highlighted the difference in indentation between the left and the right side of the column.

How can I adjust the VST so the right indent becomes the same size as the left indent? Do I have to hack the VST source code? If so, can anybody point me to the right place in the code?

Glorfindel
  • 21,988
  • 13
  • 81
  • 109
Erik Virtel
  • 810
  • 2
  • 9
  • 27

1 Answers1

5

Write the OnAfterGetMaxColumnWidth event handler and increase the MaxWidth parameter there. I haven't found a property doing this.

procedure VirtualStringTreeAfterGetMaxColumnWidth(Sender: TVTHeader; 
  Column: TColumnIndex; var MaxWidth: Integer);
begin
  MaxWidth := MaxWidth + VirtualStringTree.TextMargin;
end;
TLama
  • 75,147
  • 17
  • 214
  • 392