How to adjust the indentation of a Virtual TreeView column when resizing automatically?

I want my columns in VirtualStringTree to have the same indent to the left and right of the content when automatically sizing the column.

Take a look at my sample VST with the Header Option hoDblClickResize enabled.

VST sample image

In this image, I double-clicked the column heading to automatically resize the Time column. I highlighted the difference in the indentation between the left and right sides of the column.

How to configure VST so that the right indent becomes the same size as the left indent? Do I need to hack VST source code? If so, can someone point me to the right place in the code?

+5
source share
1 answer

OnAfterGetMaxColumnWidth MaxWidth. , .

procedure VirtualStringTreeAfterGetMaxColumnWidth(Sender: TVTHeader; 
  Column: TColumnIndex; var MaxWidth: Integer);
begin
  MaxWidth := MaxWidth + VirtualStringTree.TextMargin;
end;
+5

All Articles