Jump to content

Move node in first level of treeview generated error


JamesC

Recommended Posts

Tried to move treenode in first level of a treeview, exception raised with ACCESS_VIOLATION message. Code is shown below and it can be run properly in VCL application (change variables from TUniTreeNode to TTreeNode).

// Move up TreeNode in same level
procedure TFrameMachineGroup.UniToolButton1Click(Sender: TObject);
var
  tnSrc, tnDst: TUniTreeNode;
begin
  tnSrc := UniTreeView1.Selected;
  tnDst := tnSrc.GetPrevSibling;
  if tnDst <> nil then
    tnSrc.MoveTo(tnDst, naInsert);
  tnSrc.Selected := True;
end;

This code can run properly for other nodes under first level. Any mistake in my code? Thanks.

Testing with 1.90.0.1555 Trial.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...