VFW110 Simple Drag and Drop

VLF Windows Application Development

VFW110 – Simple Drag and Drop

Introduction

Drag and Drop is a common and useful feature in Windows applications. You should already be familiar with the concepts of drag and drop from your experience using the Visual LANSA development environment. For example, you drag and drop controls onto a form.

Most users will be familiar with drag and drop as it is an integral part of the Windows operating system. Drag and Drop is a practical way to copy or move an item from one context area to another. The copied or moved item can be virtually anything.

Drag and Drop includes these steps:

1.   Select the item to 'drag' by pressing a mouse button down (usually the left button) on the item.

2.  While the mouse button is held down, move the mouse to the target destination area.

3.  Release the mouse button so that the item to be copied/moved is "dropped" in the target area.

There are four different events that can be involved in a drag and drop operation:

  • StartDrag
  • ragOver
  • DragDrop
  • EndDrag.

Note: A Drag and Drop operation may not require all of these events.

Objective

To build a command handler for the Departments business object which enables Sections to be transferred to another Department, using drag and drop. This is described as 'simple drag and drop' because the action occurs within a single form. This simplifies the steps required to implement the drag and drop action.

To achieve this objective you will complete the following steps:

Step 1. Create Transfer Section to Department Command Handler

Step 2. Add Logic to the Transfer Sections to Department Command Handler.

Step 3. Test the Transfer Section to Department Command Handler

Summary

Before You Begin

You must have completed exercises VFW030, VFW040 and VFW042.