anchor.diff:      tree.Invalidate;
       tree.Selection := n;
     end;
  +end;
  +
  +procedure TMainForm.TreeNodeChanged(Sender: TObject);
  +const
  +  cParent = 'Parent = %s';
  +  cPrev = 'Prev = %s';
  +  cNext = 'Next = %s';
  +  cFirstSubNode = 'FirstSubnode = %s';
  +  cLastSubNode = 'LastSubnode = %s';
  +var
  +  n: TfpgTreeNode;
  +
  +  procedure PrintNodeInfo(ALabel: TfpgLabel; AFormat: string; ANode: TfpgTreeNode);
  +  begin
  +    if ANode = nil then
  +      ALabel.Text := Format(AFormat, ['nil'])
  +    else
  +      ALabel.Text := Format(AFormat, [ANode.Text]);
  +  end;
  +
  +begin
  +  n := Tree.Selection;
  +  PrintNodeInfo(Label1, cParent, n.Parent);
  +  PrintNodeInfo(Label2, cPrev, n.Prev);
  +  PrintNodeInfo(Label3, cNext, n.Next);
  +  PrintNodeInfo(Label4, cFirstSubNode, n.FirstSubNode);
  +  PrintNodeInfo(Label5, cLastSubNode, n.LastSubNode);
   end;
   
   procedure TMainForm.PopulateTree;
  
positive.code:     n2.AppendText('Child 1').AppendText('Child 2');
      n2.Collapsed := False;
    end;
  end;
  
  procedure TMainForm.cbShowImagesChange(Sender: TObject);
  
negative.code:     Anchors := [anLeft,anBottom];
      Checked := True;
      FontDesc := '#Label1';
      Hint := '';
      TabOrder := 1;
      Text := 'Show images';
      OnChange := @cbShowImagesChange;
  