Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Pascal Delphi Misc > Moving items in...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 2 Topic 5992 of 6114
Post > Topic >>

Moving items in TreeView

by Fons <fonzzzNO@[EMAIL PROTECTED] > Feb 22, 2008 at 07:46 PM

This "works":

procedure TFormTestTreeView.TreeViewDragOver(Sender, Source: TObject; X,
   Y: Integer; State: TDragState; var Accept: Boolean);
begin
   if Sender is TTreeView then Accept := True;
end;

procedure TFormTestTreeView.TreeViewDragDrop(
   Sender, Source: TObject; X, Y: Integer
);
var TargetNode, SourceNode, NewNode : TTreeNode;
begin
   TargetNode := TTreeView(Sender).GetNodeAt(X,Y);
   SourceNode := TTreeView(Sender).Selected;
   if TargetNode = nil then
     TTreeView(Sender).EndDrag(False)
   else
     SourceNode.MoveTo(TargetNode, naAddChild);
end;

It moves the textitem but not the ImageIndex and StateIndex. The image 
doesn't move with it. Why not ? And how about the 
TTreeNode.Data-pointer? Although I only need the StateIndex.

Fons.
 




 2 Posts in Topic:
Moving items in TreeView
Fons <fonzzzNO@[EMAIL   2008-02-22 19:46:42 
Re: Moving items in TreeView
Fons <fonzzzNO@[EMAIL   2008-02-22 22:17:39 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Thu Jul 24 23:41:02 CDT 2008.