VB Migration Partner

KNOWLEDGE BASE - Forms and controls

Previous | Index | Next 

[INFO] How VB Migration Partner implements drag-and-drop features

VB Migration Partner fully supports OLE drag-and-drop features. Starting with version 1.20, “classic” drag-and-drop is also supported.

When the drag-and-drop operation is initiated automatically – which happens always when using “classic” drag-and-drop and can happen with OLE drag-and-drop when the OLEDragMode property is set to 1-vbOLEDragAutomatic – there are a couple important differences from VB6:

  1. an automatic drag-and-drop operation can be initiated by pressing the either the left or the right mouse button and then dragging (VB6 only supports the left button). Supporting the mouse button is necessary for controls that can contain editable text (e.g. the TextBox control), because dragging with the left button would change the text selection.
  2. The drag operation begins only when the mouse cursor is moved outside the source control’s border. Only after this point all events that are related to drag-and-drop – e.g. OLEStartDrag) will fire.

 “Classic” drag-and-drop
From the end users’ perspective, an important difference is what they see when they initiate a drag operation and the DragIcon property is Nothing. In VB6 the mouse cursor is replaced by the rectangular outline of the control being dragged, whereas in converted VB.NET application a default icon is used.

If you aren’t satisfied with the default icon, you can use a custom icon by assigning a Bitmap object to the VB6Config.DragIcon property, as in:

        VB6Config.DragIcon = LoadPicture6("c:\dragicon.bmp")

Another minor difference with the VB6 behavior: if you end an ongoing drag operation by means of the Drag method, the target control receives a DragDrop event immediately (as in VB6), but the user interface will be inactive and no other mouse-related event will be fired until you release the mouse button.

OLE drag-and-drop
Except for the two points described above, the support for OLE drag-and-drop is complete.

Consider, however, that the RichTextBox control reacts to automatic drag-and-drop in a peculiar way and has an inconsistent behavior when a file is dropped on it, for example at the end of a drag-and-drop operation initiated from Windows Explorer: depending on the nature of the file, the RichTextBox control either displays the file contents or the file icon and name. The VB.NET version of the RichTextBox always displays the file contents. You can work around these issues by using OLE drag-and-drop in manual mode.

Previous | Index | Next 

Follow Francesco Balena on VB6 migration’s group on


Read Microsoft Corp’s official case study of a VB6 conversion using VB Migration Partner.

Code Architects and its partners offers remote and onsite migration services.

More details

Subscribe to our free newsletter for useful VB6 migration tips and techniques.


To learn more about your VB6 applications, run VB6 Analyzer on your source code and send us the generated text file. You will receive a detailed report about your VB6 applications and how VB Migration Partner can help you to quickly and effectively migrate it to .NET.

Get free advice

A fully-working, time-limited Trial Edition of VB Migration Partner allows you to test it against your actual code

Get the Trial

The price of VB Migration Partner depends on the size of the VB6 application, the type of license, and other factors

Request a quote

Migrating a VB6 application in 10 easy steps

Comparing VB Migration Partner with Upgrade Wizard

Migration tools: Feature Comparison Table

All whitepapers