473,385 Members | 1,344 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Clipboard question!

Lee
Hi,

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

thanks in advance
lee
Sep 21 '06 #1
3 3479
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

"Lee" wrote:
Hi,

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

thanks in advance
lee
Sep 21 '06 #2
On Thu, 21 Sep 2006 10:53:17 +0100, Lee wrote:
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
--
Tom Porterfield
Sep 21 '06 #3
Oh yes, I hadn't noticed that about it before. I have always looked for the
dataformat I was expecting.

Ciaran O'Donnell

"Tom Porterfield" wrote:
On Thu, 21 Sep 2006 10:53:17 +0100, Lee wrote:
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
--
Tom Porterfield
Sep 21 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: LG | last post by:
Just have a question with regards to the clipboard, and how to read what other applications (Adobe InDesignCS) place in the clipboard. I am currently in the process of creating a booklet from a...
1
by: Silesian | last post by:
Hi all, I have a small routine that copies a text field in my application. I want to be able to do this: Clipboard.SetDataObject ("") ,after the user has pasted the text into another application....
0
by: Christopher | last post by:
Hello, First, I appologize for the length but I want to get all the facts down so as not to waste any time :) I'm trying to allow the user of my C# app to copy a DataGrid full of double values...
4
by: JohnR | last post by:
Hi all, I'm finally sick and tired of manually generating get/set properties for each private variable in a class so I'm trying to create a macro to do it. I'm stuck because I can't figure out...
0
by: James Russo | last post by:
Hello, I have an application which requires an image to be retrived from the clipboard. So, I am writting a quick C# windows application to take images from a webcam and store a single frame on...
0
by: MKBender | last post by:
dear all, I'm try to differential between datagridview data that is copied from a cell and a row. If I can setup two clipboards that would make it easy? is this possible? Seeing how both the row...
7
by: Newbie | last post by:
How do I clear the clipboard in VB.NET 2003? TIA Newbie
23
by: Over | last post by:
Hi it's possible with language C, (Mingw or Djgpp) copying the clipboard of WinXp into file.txt? which function must be use. Thanks
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.