PC Review


Reply
Thread Tools Rate Thread

Drag-n-Drop with ListBox

 
 
Jacob W Anderson
Guest
Posts: n/a
 
      6th Aug 2003
Hi all,

I want to setup a drag source in a Windows.Forms.ListBox
control, but I don't see any docs on how to do this.
Unlike the TreeView, the ListBox has no ItemDrag event
handler, so it looks like I have to use the MouseDown
event. Is that correct:

if(_listSpec.SelectedItem != null)
{
DoDragDrop(_listSpec.SelectedItem,
DragDropEffects.Copy);
}

The problem with this model is that in the drag
destination, the drag value is always the first item in
the source list (_listSpec).

Does anybody have some sample code for implementing a
ListBox as a drag source? (in C# preferably)

Thanks

-- Jake
(E-Mail Removed)


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
drag/drop from listbox to listbox, but multiextended mode Bernie Yaeger Microsoft VB .NET 2 27th Jan 2005 03:51 AM
drag-drop from one listbox to another Bernie Yaeger Microsoft VB .NET 0 23rd Oct 2004 05:55 PM
ListBox drag & drop GMet Microsoft Excel Programming 0 24th Sep 2004 03:50 PM
Re: Listbox Drag & Drop Sijin Joseph Microsoft Dot NET 0 29th Aug 2004 11:37 AM
ListBox Drag and Drop =?Utf-8?B?RXJpYw==?= Microsoft C# .NET 0 23rd Jan 2004 02:11 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:04 PM.