Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var
- Node: PVirtualNode;
- begin
- VirtualStringTree1.BeginUpdate;
- try
- // add two columns
- VirtualStringTree1.Header.Columns.Add;
- VirtualStringTree1.Header.Columns.Add;
- // set the main column to the second one
- VirtualStringTree1.Header.MainColumn := 1;
- // make the header visible
- VirtualStringTree1.Header.Options := VirtualStringTree1.Header.Options + [hoVisible];
- // include the global check support
- VirtualStringTree1.TreeOptions.MiscOptions := VirtualStringTree1.TreeOptions.MiscOptions + [toCheckSupport];
- // hide the root as it looks ugly with the second column set as main
- VirtualStringTree1.TreeOptions.PaintOptions := VirtualStringTree1.TreeOptions.PaintOptions - [toShowRoot];
- // and add a few nodes with check boxes
- Node := VirtualStringTree1.AddChild(nil);
- Node.CheckType := ctCheckBox;
- Node := VirtualStringTree1.AddChild(nil);
- Node.CheckType := ctCheckBox;
- Node := VirtualStringTree1.AddChild(nil);
- Node.CheckType := ctCheckBox;
- finally
- VirtualStringTree1.EndUpdate;
- end;
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement