I'm want to store an object in the clipboard and retrieve it later on. This object is an instance of my own class that aren't pre-defined DataFormats.
I have this code to store MyObject into clipboard
And this code try to retrieve the object back from clipboard
The problem is that MyObject returned from the clipboard is always null (Nothing in VB)
Whats wrong here?
I have this code to store MyObject into clipboard
Code:
Clipboard.SetDataObject(MyObject, True)
And this code try to retrieve the object back from clipboard
Code:
Dim MyObject As MyClass = Clipboard.GetDataObject().GetData(MyClass.GetType)
If MyObject Is Nothing Then Exit Sub
The problem is that MyObject returned from the clipboard is always null (Nothing in VB)
Whats wrong here?