STK X Send comments on this topic.
OLEDragDrop Event (AgUiAxVOCntrl)
See Also  Example
Data
A DataObject  object containing the list of files dropped onto the control.
Effect
A long integer set by the target component identifying the action that has been performed (if any), thus allowing the source to take appropriate action if the component was moved (such as the source deleting the data).
Button
An integer which acts as a bit field corresponding to the state of a mouse button when it is depressed. The left button is bit 0, the right button is bit 1, and the middle button is bit 2. These bits correspond to the values 1, 2, and 4, respectively. It indicates the state of the mouse buttons; some, all, or none of these three bits can be set, indicating that some, all, or none of the buttons are depressed.
Shift
An integer which acts as a bit field corresponding to the state of the SHIFT, CTRL, and ALT keys when they are depressed. The SHIFT key is bit 0, the CTRL key is bit 1, and the ALT key is bit 2. These bits correspond to the values 1, 2, and 4, respectively. The Shift parameter indicates the state of these keys; some, all, or none of the bits can be set, indicating that some, all, or none of the keys are depressed. For example, if both the CTRL and ALT keys were depressed, the value of Shift would be 6.
X
Returns a number that specifies the x-position of the current location of the mouse pointer. The x and y values are always expressed in terms of the screen coordinate system.
Y
Returns a number that specifies the y-position of the current location of the mouse pointer. The x and y values are always expressed in terms of the screen coordinate system.





Description

Fired when a source component is dropped onto the control

Syntax

[Visual Basic .NET]
Public Event OLEDragDrop( _
   ByVal Data As AgDataObject, _
   ByVal Effect As Integer, _
   ByVal Button As Integer, _
   ByVal Shift As Integer, _
   ByVal X As Integer, _
   ByVal Y As Integer _
)

[C#]
public void OLEDragDrop(
AgDataObject Data,
int Effect,
int Button,
int Shift,
int X,
int Y
);

[Managed C++]
public: void OLEDragDrop(
AgDataObject ^ Data,
int Effect,
int Button,
int Shift,
int X,
int Y
);

[Java]
public  oLEDragDrop(
AgDataObject Data,
int Effect,
ppInteger Button,
ppInteger Shift,
int X,
int Y
);

[Unmanaged C++]
public: HRESULT OLEDragDrop(
AgDataObject * Data,
long Effect,
int Button,
int Shift,
long X,
long Y
);

Parameters

Data
A DataObject  object containing the list of files dropped onto the control.
Effect
A long integer set by the target component identifying the action that has been performed (if any), thus allowing the source to take appropriate action if the component was moved (such as the source deleting the data).
Button
An integer which acts as a bit field corresponding to the state of a mouse button when it is depressed. The left button is bit 0, the right button is bit 1, and the middle button is bit 2. These bits correspond to the values 1, 2, and 4, respectively. It indicates the state of the mouse buttons; some, all, or none of these three bits can be set, indicating that some, all, or none of the buttons are depressed.
Shift
An integer which acts as a bit field corresponding to the state of the SHIFT, CTRL, and ALT keys when they are depressed. The SHIFT key is bit 0, the CTRL key is bit 1, and the ALT key is bit 2. These bits correspond to the values 1, 2, and 4, respectively. The Shift parameter indicates the state of these keys; some, all, or none of the bits can be set, indicating that some, all, or none of the keys are depressed. For example, if both the CTRL and ALT keys were depressed, the value of Shift would be 6.
X
Returns a number that specifies the x-position of the current location of the mouse pointer. The x and y values are always expressed in terms of the screen coordinate system.
Y
Returns a number that specifies the y-position of the current location of the mouse pointer. The x and y values are always expressed in terms of the screen coordinate system.

Remarks

The Map control supports manual and automatic OLE drag and drop events. This event is triggered or not based on the state of the OLEDropMode property: it is triggered only if the OLEDropMode property is set to manual.

Only dropping files is currently supported. The mouse is used to drag and drop data between applications and controls. For example, you can select a set of files in the Windows Explorer. You can then press and hold the mouse button down while dragging the files, then release the mouse button to drop them onto the Map control. During the OLE drag-and-drop operation, the mouse cursor changes to indicate that an OLE drag-and-drop operation is in effect.

Example

[Visual Basic .NET] Copy Code
Private Sub AxAgUiAxVOCntrl1_OLEDragDrop( _
            ByVal sender As System.Object, _
            ByVal e As AxAGI.STKX.IAgUiAxVOCntrlEvents_OLEDragDropEvent) _
        Handles AxAgUiAxVOCntrl1.OLEDragDrop

    Dim ControlWindowPoint As Point

    ControlWindowPoint = AxAgUiAx2DCntrl1.PointToClient(New Point(e.x, e.y))

    MessageBox.Show("Control Position = " & " X = " & ControlWindowPoint.X & _
                    "," & " Y = " & ControlWindowPoint.Y)


End Sub

See Also

© 2016 Analytical Graphics, Inc. All Rights Reserved.

STK Programming Interface 11.0.1