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 / Windows Forms / WinForm General / February 2007

Tip: Looking for answers? Try searching our database.

help with where the item will be dropped during drag drop

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Tarscher - 22 Feb 2007 08:43 GMT
Hi all,

Users can rearrange a listbox by a drag drop operation. All is
implemented but it's not always easy for the user to know where
exactly he is dropping his item. Does .net provide you with some sort
of functionality that indicates where you will drop your item?

Eg: when the user hovers between 2 items (Item3 and 4 here) a line
shows that it will be dropped between those 2 items. Can this be done?

Item1
Item2
item3
--------
Item4

Thanks,
Stijn
ClayB - 22 Feb 2007 09:12 GMT
Not sure how you are doing your D&D, but if you are using the Control
D&D events, one simple thing you could do is to move the selection are
you move the drop as below. To display a little line at the insertion
point would require more work.

void listBox2_DragOver(object sender, DragEventArgs e)
   {
       Point pt = this.listBox2.PointToClient(new Point(e.X, e.Y));
       int index = this.listBox2.IndexFromPoint(pt);
       if (index > -1 && index < list2.Count)
           this.listBox2.SelectedIndex = index;
   }
===============
Clay Burch
Syncfusion, Inc.
ClayB - 22 Feb 2007 11:16 GMT
You can find sample code in this FAQ entry that shows how to display a
red line at the drop site.

http://www.syncfusion.com/FAQ/WindowsForms/FAQ_c87c.aspx#q610q

=====================
Clay Burch
Syncfusion, Inc.

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.