Thread View: borland.public.delphi.vcl.components.using.dotnet
2 messages
2 total messages
Started by Steve Baker
Tue, 29 Jan 2008 22:13
Moving Tree Nodes
Author: Steve Baker
Date: Tue, 29 Jan 2008 22:13
Date: Tue, 29 Jan 2008 22:13
15 lines
1487 bytes
1487 bytes
I wrote an application in Delphi 7 in which I can drag and drop nodes within the tree. The same code in Delphi 2008 for dotNet doesn't work. In general, I can move one node, but subsequent moves give the error "Item has already been added. Key in dictionalry: ...". procedure TMainF.tvDragOver(Sender, Source: TObject; X, Y: Integer; State: TDragState; var Accept: Boolean); begin If tv.GetNodeAt(X, Y) <> Nil Then Accept := True; end; procedure TMainF.tvDragDrop(Sender, Source: TObject; X, Y: Integer); begin tv.Selected.MoveTo(tv.GetNodeAt(X, Y), naAddChild);
Re: Moving Tree Nodes
Author: Steve Baker
Date: Tue, 29 Jan 2008 23:57
Date: Tue, 29 Jan 2008 23:57
23 lines
1924 bytes
1924 bytes
I just went back and tried the exact code in Delphi 2007 as a VCL Forms application and it works just fine. There must be something terribly wrong in 2008. "Steve Baker" <Steve@Umtanum.com> wrote in message news:479fa509$1@newsgroups.borland.com... >I wrote an application in Delphi 7 in which I can drag and drop nodes >within the tree. The same code in Delphi 2008 for dotNet doesn't work. In >general, I can move one node, but subsequent moves give the error "Item has >already been added. Key in dictionalry: ...". > > > procedure TMainF.tvDragOver(Sender, Source: TObject; X, Y: Integer; > State: TDragState; var Accept: Boolean); > begin > If tv.GetNodeAt(X, Y) <> Nil Then Accept := True; > end; > > procedure TMainF.tvDragDrop(Sender, Source: TObject; X, Y: Integer); > begin > tv.Selected.MoveTo(tv.GetNodeAt(X, Y), naAddChild); > >
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads