Clipboard.SetData("Class1Format", new Class1("42")); if (Clipboard.ContainsData("Class1Format")) { Class1 o = Clipboard.GetData("Class1Format") as Class1; // is is null here so the line below will throw an exception MessageBox.Show(o.MyMethod()); } else { MessageBox.Show("Ain't nothing there!!"); }I think the instance of Class1 is placed in the clipboard successfully but there are some issues retreiving it. I have also tried the "old" way:
Clipboard.SetDataObject(new Class1("42")); Class1 o = Clipboard.GetDataObject() as Class1; // o is null!! MessageBox.Show(o.MyMethod());I got a feeling is is something very simple that I am missing.