vincent90152900

How to determine is there any data stored on the clipboard in C#
Many thanks for your replying.


Re: Visual C# General How to determine is there any data stored on the clipboard in C#?

Jeremy Filburn

I would start by looking into this CodeProject article by Nish






Re: Visual C# General How to determine is there any data stored on the clipboard in C#?

vincent90152900

It is very helpful.
Thank you.




Re: Visual C# General How to determine is there any data stored on the clipboard in C#?

Martin Xie - MSFT

Hello Vincent,

I would like to suggest you refer to this MSDN document.

How to: Retrieve Data from the Clipboard

To determine whether the Clipboard contains data in a particular format, use one of the ContainsFormat methods or the GetData method. To retrieve data from the Clipboard, use one of the GetFormat methods or the GetData method.

e.g.

if (Clipboard.GetData(DataFormats.Text) != null)
MessageBox.Show("Text Data stored");
else
MessageBox.Show("Null");

Best Regards,

Martin Xie






Re: Visual C# General How to determine is there any data stored on the clipboard in C#?

vincent90152900

That is a very good idea.
Many thanks for your suggestion.