Re: Using Drag and Drop between controls
- From: JohnBury <JohnBury@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 18 Aug 2006 03:01:02 -0700
Mark
Your idea intrigues me.
I hadn't thought of DnD within the treeview.
Hmmm! I think this will work for me (as well as giving an opportunity to
neatly/more elegantly provide extra info to the user).
I haven't checked this out , but when dragging with the TreeView, is it a
simple task to identify which node you have dropped an item on?
Thanks for the advice (You may get a mention in the credits!! :) )
Regards
--
UK John
"Mark J. McGinty" wrote:
.
"JohnBury" <JohnBury@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:E8AF7753-51BC-4BCE-BF9C-540A19527C8B@xxxxxxxxxxxxxxxx
I am trying to create a form that (at least) contains a treeview (holding
hierarchical information about school departments and programs of study)
and
a listbox holding details of a teacher's 'classes'.
What I want to do is to be able to select a 'program of study' and drag in
onto a particular 'class' in the listbox. In code I will then allocate
that
class to that program of study.
My problem is figuring out how to detect which listbox entry I am dropping
my object onto! Is there a (hopefully) simple way to detect (and
highlight)
which list entry is under the mouse / drag icon?
Your help is (as ever) greatly appreciated (and desperatley needed!)
1. I'd use a ListView instead of a Listbox. The former has inherent DnD
capabilities; the latter does not.
2. That doesn't seem vert intuitive to me, it seems backwards... in fact,
why wouldn't the classes logically go in the TreeView as part of the
heirarchy? Then they could be intuitively dragged from one program to
another.
If the listbox is intended as a repository of unallocated classes, I'd
consider adding a tree branch called "Unallocated", maybe make them a
different color to distinguish visually, and drag from there. If it's
intended as a way to find the classes by name rather than needing to locate
them in the tree, consider an "All Classes" [psuedo] tree branch (or tree
node that fills a listview, ala folders in explorer, if the number of
classes would make dragging within the tree unweildy.)
The basic DnD paradigm is that you drag something from where it is, to where
you want it. What you describe would be like dragging a folder and dropping
it on a file, to move that file into that folder.
-Mark
Regards
--
UK John
- Follow-Ups:
- Re: Using Drag and Drop between controls
- From: Mark J. McGinty
- Re: Using Drag and Drop between controls
- References:
- Re: Using Drag and Drop between controls
- From: Mark J. McGinty
- Re: Using Drag and Drop between controls
- Prev by Date: Re: Using Drag and Drop between controls
- Next by Date: Copy access control to VB Forms
- Previous by thread: Re: Using Drag and Drop between controls
- Next by thread: Re: Using Drag and Drop between controls
- Index(es):
Relevant Pages
|