Advertisement
TLama

Untitled

Oct 16th, 2014
374
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Delphi 1.07 KB | None | 0 0
  1. var
  2.   Node: PVirtualNode;
  3. begin
  4.   VirtualStringTree1.BeginUpdate;
  5.   try
  6.     // add two columns
  7.     VirtualStringTree1.Header.Columns.Add;
  8.     VirtualStringTree1.Header.Columns.Add;
  9.     // set the main column to the second one
  10.     VirtualStringTree1.Header.MainColumn := 1;
  11.     // make the header visible
  12.     VirtualStringTree1.Header.Options := VirtualStringTree1.Header.Options + [hoVisible];
  13.     // include the global check support
  14.     VirtualStringTree1.TreeOptions.MiscOptions := VirtualStringTree1.TreeOptions.MiscOptions + [toCheckSupport];
  15.     // hide the root as it looks ugly with the second column set as main
  16.     VirtualStringTree1.TreeOptions.PaintOptions := VirtualStringTree1.TreeOptions.PaintOptions - [toShowRoot];
  17.     // and add a few nodes with check boxes
  18.     Node := VirtualStringTree1.AddChild(nil);
  19.     Node.CheckType := ctCheckBox;
  20.     Node := VirtualStringTree1.AddChild(nil);
  21.     Node.CheckType := ctCheckBox;
  22.     Node := VirtualStringTree1.AddChild(nil);
  23.     Node.CheckType := ctCheckBox;
  24.   finally
  25.     VirtualStringTree1.EndUpdate;
  26.   end;
  27. end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement