#694 – An Example of Custom Drag-and-Drop Behavior

You can define your own drag-and-drop behavior in an application, defining the content to be dragged and the controls that the user drags the content from and to.  The basic process for drag-and-drop is:

  • User presses and holds a mouse button (typically left mouse button) on a control that contains the data to be dragged (the source element)
  • User moves mouse pointer over another control, where the data is to be dropped (the target element)
  • User releases mouse button
  • Data is “dropped” onto target control (control is typically updated to reflect new content)

In the example below, the user can select some text in the TextBox and drag it to the ListBox, adding a new item to the list for each chunk of text dragged.

Advertisement

About Sean
Software developer in the Twin Cities area, passionate about software development and sailing.

2 Responses to #694 – An Example of Custom Drag-and-Drop Behavior

  1. Pingback: Dew Drop – November 20, 2012 (#1,446) | Alvin Ashcraft's Morning Dew

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: