Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

auto-select nodes in ttreeview via wmdropfiles

Status
Not open for further replies.

tarja311

Programmer
Jan 23, 2007
7
US
Hi guys,

I am building a chat application, and in this application is a TTreeView component that displays the list of contacts. This works great. I then implemented "WMDROPFILES" so they can drag 'n drop files from their desktops onto their contacts as a quick way to send data files (doc, zip, mp3, ect). This also works flawlessly.

My problem is that the user *has* to highlight the contact first in order to send something. When a file is dragged over a specific contact, it does not automatically highlight (select) them, it responds to what ever was previously highlighted.

Does anyone know how I can get it to auto-select a node (contact) in a TTreeView?

I am using :
- CodeGear Delphi 2007
- Windows Vista SP1

Thanks!
 
I'm not in Delphi at the moment, but the 1st thing I'd look for is property 'OnMouseOver' event in TreeView (or it's descendant) and initiate the 'Select'.

Roo
Delphi Rules!
 
Perhaps DropTarget? From help: "Read DropTarget to determine whether a node in the tree view is drawn as the target of a drag and drop operation. Set DropTarget when specifying a particular node in the tree view as the drop target of a dragged item."

Hot Track will help the user to get the right node and then perhaps OnMouseUp will give you the X, Y values to use the .getnodeat method.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top