Clipboard question!

  • Thread starter Thread starter Lee
  • Start date Start date
L

Lee

Hi,

How do i check to see if the clipboard is empty?

thanks in advance
lee
 
You cant check for completely empty in one call. You need to know what type
of data you are looking for. You can then call
Clipboard.ContainsData
and use the DataFormats object to get the appropriate parameter for the
function
e.g to check is there is a .net string on there:
Clipboard.ContainsData(DataFormats.StringFormat);

HTH

Ciaran O'Donnell
 
Hi,

How do i check to see if the clipboard is empty?

thanks in advance
lee

IDataObject data = System.Windows.Forms.Clipboard.GetDataObject();
if (data == null)
// clipboard is empty
else
// clipboard has data
 
Oh yes, I hadn't noticed that about it before. I have always looked for the
dataformat I was expecting.

Ciaran O'Donnell
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top