Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Managed C++ / May 2004

Tip: Looking for answers? Try searching our database.

Changing places on items in treeview!

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Lars Gr?tteland - 07 May 2004 09:10 GMT
Hello!

During drag&drop of items in a CTreeView - how do I replace items on the
tree which I drag an item on top of.

We can use the example of WindowsXP. In the start menu -> Programs ->
Startup. I can change places on items in that folder. How can I do that in
the treeview? Anyone know?

Signature

- Lars

Simon Trew - 07 May 2004 10:45 GMT
Use TreeView_SelectItem for the drop source and TreeView_SelectDropTarget
for the drop target. You may also want the "track select" style turned on
and use TreeView_CreateDragImage for the source item.

Use TreeView_GetItem, then TreeView_DeleteItem and TreeView_InsertItem to
move it. (Using TreeView_GetItem with all the flags set should get you as
much information as you need to re-insert the item without losing
information.)

This still won't quite be like the menus (it will select an item rather than
show an insertion point between items) but it's probably as near as you are
going to get with a tree.

See "CTreeCtrl, drag and drop operations" in MSDN for more information.

> Hello!
>
[quoted text clipped - 4 lines]
> Startup. I can change places on items in that folder. How can I do that in
> the treeview? Anyone know?

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.