Using "Clipboard.GetDataObject" method. Sample code as follows: IDataObject idata = Clipboard.GetDataObject(); if( idata != null ) { //there are some data stored in clipboard }
I just realize that the code will be true always. Please check it out.
Sample code as follows: Clipboard.Clear(); IDataObject idata = Clipboard.GetDataObject(); if (idata != null) { string[] strFormats = idata.GetFormats(); if (strFormats.Length == 0) { //No data here } }
//How about create an IDataObject that contain the “empty” object during the //Initialize phase by following codes.Clipboard.Clear(); IDataObject emptyClipboard = Clipboard.GetDataObject();//Then manipulate the clipboard to do whatever need to do.//Last, use the Clipboard.Equals() method to determine current clipboard status, like //following codes.bool determineData = Clipboard.Equals(emptyClipboard, idata);
Sample code as follows:
IDataObject idata = Clipboard.GetDataObject();
if( idata != null )
{
//there are some data stored in clipboard
}
Thank you very much.
IDataObject idata = Clipboard.GetDataObject();
if (idata != null)
{
MessageBox.Show("true");
}
else
{
MessageBox.Show("false");
}
I just realize that the code will be true always.
Please check it out.
Clipboard.Clear();
IDataObject idata = Clipboard.GetDataObject();
if (idata != null)
{
string[] strFormats = idata.GetFormats();
if (strFormats.Length == 0)
{
//No data here
}
}
IDataObject emptyClipboard = Clipboard.GetDataObject();//Then manipulate the clipboard to do whatever need to do.//Last, use the Clipboard.Equals() method to determine current clipboard status, like //following codes.bool determineData = Clipboard.Equals(emptyClipboard, idata);