anchor.diff:  end;
   
   function TfpgTreeview.NextVisualNode(ANode: TfpgTreeNode): TfpgTreeNode;
  -label
  -  nextnode;
  -begin
  -  {$Note Remove the use of Label and Goto! Quick!!! }
  -  result := nil;
  -  if aNode.Collapsed then
  -  begin
  -    nextnode:
  -    if aNode.Next <> nil then
  -    begin
  -      result := aNode.Next;
  -      exit;
  +  //----------------
  +  procedure _FindNextNode;
  +  begin
  +    if ANode.Next <> nil then
  +    begin
  +      result := ANode.Next;
       end
       else
       begin
  -      while aNode.next = nil do
  -      begin
  -        aNode := aNode.Parent;
  -        if aNode = nil then
  -          exit;
  +      while ANode.Next = nil do
  +      begin
  +        ANode := ANode.Parent;
  +        if ANode = nil then
  +          exit;  //==>
         end;
  -      result := aNode.Next;
  -      exit;
  -    end;
  +      result := ANode.Next;
  +    end;
  +  end;
  +
  +begin
  +  result := nil;
  +  if ANode.Collapsed then
  +  begin
  +    _FindNextNode;
     end
     else
     begin
  -    if aNode.Count > 0 then
  -    begin
  -      result := aNode.FirstSubNode;
  -      exit;
  +    if ANode.Count > 0 then
  +    begin
  +      result := ANode.FirstSubNode;
       end
       else
  -      goto nextnode;
  +      _FindNextNode;
     end;
   end;
   
  
positive.code:   n := ANode;
    if ANode.Prev <> nil then
    begin
      result := ANode.Prev;
      ANode := ANode.Prev;
      while (not ANode.Collapsed) and (ANode.Count > 0) do
      begin
        result := ANode.LastSubNode;
        aNode := ANode.LastSubNode;
      end;
    end
    else
  
negative.code: 
  procedure TfpgTreeview.HandleKeyPress(var keycode: word;
    var shiftstate: TShiftState; var consumed: boolean);
  var
    h: TfpgTreeNode;
    OldSelection: TfpgTreeNode;
  begin
    OldSelection := Selection;
    case KeyCode of
      keyRight:
        begin
          Consumed := True;
          Selection.Collapsed := false;
          DoExpand(Selection);
          ResetScrollbar;
          RePaint;
        end;
        
      keyLeft:
        begin
          Consumed := True;
          Selection.Collapsed := true;
          ResetScrollbar;
          RePaint;
        end;
        
      keyUp:
        begin
          if Selection = nil then
            Selection := RootNode.FirstSubNode
          else
            if Selection <> RootNode then
            begin
              if NodeIsVisible(selection) then
              begin
                h := PrevVisualNode(Selection);
                if (h <> RootNode) and (h <> nil) then
                  Selection := h;
              end
              else
              begin
                Selection := RootNode.FirstSubNode;
              end;
            end;
            Consumed := True;
        end;
        
      keyDown:
        begin
          Consumed := True;
          if Selection = nil then
            Selection := RootNode.FirstSubNode
          else
          begin
            if NodeIsVisible(selection) then
            begin
              h := NextVisualNode(Selection);
              if (h <> nil) then
                Selection := h;
            end
            else
              Selection := RootNode.FirstSubNode;
          end;
        end;
        
      else
        Consumed := False;
    end;
  
    if Selection <> OldSelection then
    begin
      RePaint;
      DoChange;
    end;
  
    if not Consumed then
      inherited HandleKeyPress(keycode, shiftstate, consumed);
  end;
  
  procedure TfpgTreeview.HandleMouseScroll(x, y: integer;
  