Re: Using Drag and Drop between controls

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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



.



Relevant Pages

  • Drag&Drop in wxListCtrl
    ... I have to create a ListBox in which I have to move items up and down ... How to create drag and drop call backs in wxListCtrl. ... how can I achieve DnD with ListCtrl? ...
    (comp.lang.python)
  • Re: ttk::treeview tags
    ... FYI - There may be a bit of a performance problem with the ttk::treeview ... when using it as a listbox and inserting at the end with a high volume ... inserts into the Ttk treeview took almost 1 minute with "end". ... Quadratic runtime vs. linear runtime often makes ...
    (comp.lang.tcl)
  • Re: Treeviews
    ... (re Listview) is in the realm where you have put your ... Editor and GUI classes. ... route I went - record editing on the left and a Listbox on the right. ... Then I see one of my smart buddies in Answer Exchange using a Treeview ...
    (comp.lang.cobol)
  • Re: ttk::treeview tags
    ... Joe English wrote: ... a couple other treeview improvements as well, ... FYI - There may be a bit of a performance problem with the ttk::treeview when using it as a listbox and inserting at the end with a high volume of rows. ... set d [clock milliseconds] ...
    (comp.lang.tcl)
  • Need help with dragdrop feature
    ... I've searched for that horizontal bar that indicates the index of your drop ... I have a listbox and a treeview. ... are going to be dropping the target info. ...
    (microsoft.public.dotnet.general)