How can I adjust the indentation of a Virtual TreeView column when auto resizing?
Asked Answered
L

1

7

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?

Lustral answered 20/7, 2012 at 8:55 Comment(0)
I
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;
Iguanodon answered 20/7, 2012 at 11:54 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.