aewarnick Posted August 4, 2003 Posted August 4, 2003 I have tried everything in getting my own class called a.graphics.WrappedBmp out of the clipboad. Here is the current code which I thought was most likely to work: string type= Clipboard.GetDataObject().GetFormats()[0]; a.graphics.WrappedBmp wb= (a.graphics.WrappedBmp)Clipboard.GetDataObject().GetData(this.selWB.GetType()); GetData(this.selWB.GetType()); is where my trouble is. selWB is of type a.graphics.WrappedBmp. and GetFormats()[0] confirms that the data in the clipboard is of that type. I have tried many things including different strings to represent the data type including the very one returned by GetFormats() and nothing works. I have tried typeof(a.graphics.WrappedBmp) but to no success at all. Quote C#
aewarnick Posted August 4, 2003 Author Posted August 4, 2003 There is no error, the wb is null indicating that it did not find the type I specified. Quote C#
*Experts* Volte Posted August 4, 2003 *Experts* Posted August 4, 2003 Clipboard doesn't return the object on the clipboard, it returns a DataObject class which contains information about the object. Perhaps you should try looking at that in the MSDN. Plus, the MSDN has numerous samples about the clipboard. Quote
aewarnick Posted August 4, 2003 Author Posted August 4, 2003 Actually I found that all I had to do was put [serializable] above my class and walla! It works. Quote C#
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.