------------------------------------------------------------------------
 WinAmp-Styled Dragging Sample for iGrid ActiveX
 
 Control Version: 4.6
 Environment: Visual Basic 6

 Copyright (c) 10Tec Company. All rights reserved.
------------------------------------------------------------------------

Description
===========
This sample implements dragging of selected rows inside iGrid - like you can do that in the playlist of the well-known WinAmp media player. Simply select several rows in the grid (holding down CTRL and/or SHIFT) and drag them using the mouse. Note that the list is scrolled automatically up or down if you try to move the selected rows outside of the viewport.

This functionality is implemented as a universal solution you can attach to any grid in your project easily.

Short Code Explanation
======================
We start the dragging in the StartCellDrag event of iGrid, move the selected rows in MouseEnter (the pShiftSelected sub does the work) and finish the dragging in MouseUp.

To scroll the grid vertically when the mouse pointer is outside of the grid, we use the Timer event of the control Timer1. We check the coordinates of the mouse pointer in this sub using a couple of WinAPI functions (GetCursorPos and ScreenToClient) and scroll the grid programmatically by changing the iGrid1.VScrollBar.Value property.

To attach this functionality to an iGrid in your project, you need to copy the contents of the form's module except the Form_Load event, add a Timer control to your form and change the names 'iGrid1' and 'Timer1' to the corresponding control names in your form if required.

The implemented functionality is enough universal due to the used MoveRow method of iGrid which allows you to move cells with all their contents and formatting (such as specified text color, cell background color, etc).
