473,666 Members | 2,208 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1460
Hi,
Try this code:
IDataObject d = Clipboard.GetDa taObject();

if(d.GetDataPre sent(DataFormat s.Bitmap))
{
return "Bitmap data on clipboard!!";
}
else if(d.GetDataPre sent(DataFormat s.Text))
{
return (String)d.GetDa ta(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.GetDa taObject();

if(d.GetDataPre sent(DataFormat s.Bitmap))
{
return "Bitmap data on clipboard!!";
}
else if(d.GetDataPre sent(DataFormat s.Text))
{
return (String)d.GetDa ta(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
6135
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. "Decimal Number" sometimes serves to distinguish Base 10 numbers, eg "15", from Base 2 numbers, Eg "1111". At other times "Decimal Number" serves to differentiate a number from an integer. For the rest of this post I shall only use either...
1
1820
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 store (if to file then by serializing) the clipboard data, use the clipboard, and the restore the clipboard with the temp data. The question is: apps like Word store up to 16 different formats at once on the clipboard - how do I deal with...
1
3233
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 from a Clipboard I defined a class, e.g public class AB string s int i
8
9800
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 from Explorer and paste it into my application & vice-a-versa. My question is- How can I determine if user has copied or cut the files from Windows Explorer? I want to differentiate cut & copy.
1
4844
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 wondering if anybody has experienced the same issues
1
2134
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 just started a working as a Slot Tech at a soon to be opened casino and I have been selected for the task of configuring the game software and player tracking system for 2113 machines. In a nutshell, what I need is a simple program that can...
2
945
by: vincent90152900 | last post by:
How to determine is there any data stored on the clipboard in C#? Many thanks for your replying.
1
5795
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 tare weight of vehicles. The application executes a visual basic program on the local PC that captures U] weight data from the Avery digitizer and generates an unique weighment-id for every weighment. Against the weighment-id vehicle and material...
4
951
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 selected some words or txt I want to be able to have my application know what line and position the selected text is. I would figure that I would need either the RTF text control or a third
0
8443
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8356
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8866
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8781
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8639
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6192
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4198
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2769
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1772
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.