Search
FlowChart.DropInBoxVB Event
See Also
 



Raised when some data is dropped into a box and the drag-and-drop mode is set to drProgrControlVB.

 Syntax

VB6  Copy Code

Public Event DropInBoxVB

 Event Data

Parameter

Type

Description

box

[input] reference to a Box

The box under the mouse cursor.

dataObj

[input] IVBDataObject interface pointer

A pointer to OLE drag-and-drop object.

docX

[input] long

The x document coordinate.

docY

[input] long

The y document coordinate.

keyState

[input] long

A state of keyboard modifier keys.

effect

[input, output] long

The effect of the drag-and-drop.

Dispatch ID: 56

 Remarks

Raised when some data is dropped into a box and the drag-and-drop mode is set to drProgrControlVB. dataObj is a pointer to an object implementing the OLE IVBDataObject interface. This object may contain data in several different formats; it can be queried for data in the format that is most appropriate for your application. docX and docY are the coordinates of the mouse cursor given in document coordinates. The keyState bit-mask is a combination of the following values: 0x20 (ALT), 0x04 (SHIFT), 0x08 (CTRL). The effect parameter is a combination of the allowed drop effects, and as output you can set it to the desired effect. Its possible values are: 0=none, 1=copy, 2=move, 4=link.

 Example

The following code snippet, taken from the TreeLayout sample, demonstrates handling this event. When a picture is dragged into a box, a child box is created and the picture is assigned to it:

VB6  Copy Code

Private Sub fc_DropInBoxVB(ByVal box As FLOWCHARTLibCtl.IBoxItem, ByVal dataObj As FLOWCHARTLibCtl.IVBDataObject, ByVal docX As Long, ByVal docY As Long, ByVal keyState As Long, ByVal effect As Long)

    Dim newNode As FLOWCHARTLibCtl.box
    newNode = addChild(box)

    'show the node tag
    newNode.Text = "id: " + Str(newNode.Tag) + " "

    'if a picture is dragged
    If dataObj.GetFormat(vbCFDIB) Then

        'set is a node icon
        newNode.PicturePos = picTopLeft
        newNode.Picture = dataObj.GetData(vbCFDIB)

        'and move the text to the right
        newNode.TextStyle = tsRight

    End If

End Sub

 See Also