473,385 Members | 1,772 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.

How to determine is there any data stored on the clipboard in C#?

How to determine is there any data stored on the clipboard in C#?
Many thanks for your replying.
Jul 26 '07 #1
2 1452
Hi,
Try this code:
IDataObject d = Clipboard.GetDataObject();

if(d.GetDataPresent(DataFormats.Bitmap))
{
return "Bitmap data on clipboard!!";
}
else if(d.GetDataPresent(DataFormats.Text))
{
return (String)d.GetData(DataFormats.Text);
}
else
{
return "Unknown format of data is Contained on the clipboard.";
}

--
Hope this answers your question.
Thanks and Regards.
Manish Bafna.
MCP and MCTS.

"vincent" wrote:
How to determine is there any data stored on the clipboard in C#?
Many thanks for your replying.
Jul 26 '07 #2
It is very helpful.
Thank you very much.

"Manish Bafna" wrote:
Hi,
Try this code:
IDataObject d = Clipboard.GetDataObject();

if(d.GetDataPresent(DataFormats.Bitmap))
{
return "Bitmap data on clipboard!!";
}
else if(d.GetDataPresent(DataFormats.Text))
{
return (String)d.GetData(DataFormats.Text);
}
else
{
return "Unknown format of data is Contained on the clipboard.";
}

--
Hope this answers your question.
Thanks and Regards.
Manish Bafna.
MCP and MCTS.

"vincent" wrote:
How to determine is there any data stored on the clipboard in C#?
Many thanks for your replying.
Jul 26 '07 #3

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

Similar topics

17
by: John Bentley | last post by:
John Bentley: INTRO The phrase "decimal number" within a programming context is ambiguous. It could refer to the decimal datatype or the related but separate concept of a generic decimal number....
1
by: Nukeation | last post by:
My app has to temporarily use the clipboard - and while doing so, it would delete any existing data which the user has copied (possibly from other applications). What I want to do is temporarily...
1
by: keith | last post by:
I read a book, Programming Microsoft WINDOWS with C# by Charles Petzold, which shows ho to set or get string and image to and from Clipboard. It says even a button object can be set or go to and...
8
by: Dinesh Jain | last post by:
Hi all, I encountered a serious problem while working with clipboard class in VB.NET. I want to simulate cut-copy-paste operation with my application and Windows Explorer. User can copy files...
1
by: jrs_14618 | last post by:
Hello All, This post is essentially a reply a previous post/thread here on this mailing.database.myodbc group titled: MySQL 4.0, FULL-TEXT Indexing and Search Arabic Data, Unicode I was...
1
by: phreaktor | last post by:
Let me begin by saying I admire the knowledge of some of you forum-goers. I have only taken an introductory couse in Visual Basic.NET as a supplement to my study of Electronics Engineering. I have...
2
by: vincent90152900 | last post by:
How to determine is there any data stored on the clipboard in C#? Many thanks for your replying.
1
by: archdin | last post by:
Hello experts, I m working in SAP. But this time i m working on program of weighbridge. An ABAP application is developed to get the vehicle and material information along with the gross and...
4
by: Aussie Rules | last post by:
Hi, I want to be able to show a txt file(stored on disk) to the end user in some sort of txt editor control, and allow the user to highlight/select words within the text. Once they have...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: 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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.