I am trying to get a result that looks like this from TVirtualStringTree:

I believe this is possible either directly with TVirtualStringTree (the main Virtual TVirtualStringTree control by Mike Lishke), either by subclassing and modifying the inherited control, or by switching to TVirtualDrawTree .
Here is what I can get, and shows the problem I am facing:

The problem is that I cannot get the text for column 0 to cover the entire horizontal area of ββthe virtual tree control. There is a virtual tree view demo in an extended demo showing multi-line text that seems to do what I need, but I can't figure out how to apply it in combination with the detailed columns that I need below the title bar (shown as Node , Node, Node in the picture).
Here is what I tried:
- Change the ContentRect.Right event in the BeforeCellPaint event:
- set
toGridExtensions on to TreeOptions.MiscOptions .
Here is a sample code showing how I tried to change the contentRect:
procedure TForm1.VirtualStringTree1BeforeCellPaint(Sender: TBaseVirtualTree; TargetCanvas: TCanvas; Node: PVirtualNode; Column: TColumnIndex; CellPaintMode: TVTCellPaintMode; CellRect: TRect; var ContentRect: TRect); var level:Integer; begin level := VirtualStringTree1.GetNodeLevel(Node); if (level=0) then Inc( ContentRect.Right, 300); end;
Update:
Using the answer below, I get the following:

source share