L
Lou
How do I get the data in the clipbaord fro a registered data type.
The code snippet below doesn't work? But the VB6 example does.
What am I doing wrong.
private void lstItems_DragDrop(object sender,
System.Windows.Forms.DragEventArgs e)
{
// Creates a new data format.
DataFormats.Format myFormat = DataFormats.GetFormat("myDataType");
// Create a new instance of the DataObject interface.
IDataObject data = Clipboard.GetDataObject();
lstItems.Items.Add (data.GetData(myFormat));
}
In VB6 this DOES work, this seems very simple.
Private Sub Text2_OLEDragDrop(Data As DataObject, Effect As Long, Button As
Integer, Shift As Integer, X As Single, Y As Single)
My_Format = RegisterClipboardFormat("myFormat")
Dim a() As Byte
a = Data.GetData(My_Format)
MsgBox a
End Sub
The code snippet below doesn't work? But the VB6 example does.
What am I doing wrong.
private void lstItems_DragDrop(object sender,
System.Windows.Forms.DragEventArgs e)
{
// Creates a new data format.
DataFormats.Format myFormat = DataFormats.GetFormat("myDataType");
// Create a new instance of the DataObject interface.
IDataObject data = Clipboard.GetDataObject();
lstItems.Items.Add (data.GetData(myFormat));
}
In VB6 this DOES work, this seems very simple.
Private Sub Text2_OLEDragDrop(Data As DataObject, Effect As Long, Button As
Integer, Shift As Integer, X As Single, Y As Single)
My_Format = RegisterClipboardFormat("myFormat")
Dim a() As Byte
a = Data.GetData(My_Format)
MsgBox a
End Sub