473,473 Members | 1,807 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Clipboard Functionality

Hi all

I have a problem regarding use of a clipboard functionality in .NET. As
per my knowledge we
can set the data in the clipboard of our own format. But is there any
way to clear the data after it has been set.

example
I Set the data to my format by
Data = New DataObject("MyFormat", selected)

Clipboard.SetDataObject(Data)

where selected is the array of string to set.

I use following to get the data set in my format

clipObject = Clipboard.GetDataObject()

If clipObject.GetDataPresent("MyFormat") = True Then
Dim FilesAndFolders() As String =
CType(clipObject.GetData("MyFormat"), String())

If Not FilesAndFolders Is Nothing Then
For itmCnt = 0 To FilesAndFolders.Length - 1
Debug.WriteLine(FilesAndFolders(itmCnt))
Next
End If

End If

I can get its proper

But the problem is with clearing the data set I use

clipObject = Clipboard.GetDataObject()

If clipObject.GetDataPresent("MyFormat") = True Then
Dim FilesAndFolders() As String =
CType(clipObject.GetData("MyFormat"), String())

If Not FilesAndFolders Is Nothing Then
For itmCnt = 0 To FilesAndFolders.Length - 1
clipObject.SetData("MyFormat", "")
Next
End If

End If

Is not working what could be reason is there any other efficient method
in .NET
Plz do help me thankls in advance

Dec 10 '05 #1
0 947

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

Similar topics

5
by: TC | last post by:
Hello, Here is what I'm trying to do: -- Make sure both MS Excel and MS Word are running -- Create an Excel chart -- Save the Excel file -- Copy the Excel chart onto the clipboard using Ctrl...
6
by: S Shulman | last post by:
Hi I want to write some VB code that copies to the clipboard then pastes it later, however the Clipboard is a system device that is shared between all applications and that may interfere with...
9
by: Christian Blackburn | last post by:
Hi Gang, I don't know what to make of all of this, but I'm having nothing, but trouble copying data to the clipboard which should be the easiest thing in the world. The only systems I can get...
7
by: lgbjr | last post by:
Hello All, I¡¯m using a context menu associated with some pictureboxes to provide copy/paste functionality. Copying the image to the clipboard was easy. But pasting an image from the clipboard...
0
by: sonu | last post by:
Hi all I have a problem regarding use of a clipboard functionality in .NET. As per my knowledge we can set the data in the clipboard of our own format. But is there any way to clear the data...
4
by: MARTIN LANNY | last post by:
This is how I setup clipboard in my application: dim template as string = "put to clipboard" Clipboard.SetDataObject(template) And it all works like a charm until I close my program. As soon...
7
by: Newbie | last post by:
How do I clear the clipboard in VB.NET 2003? TIA Newbie
15
by: Peter Duniho | last post by:
I'm trying to use .NET and C# to draw a metafile copied to the clipboard by another application (Word 2003 in this case, but it shouldn't matter). I naively thought that I'd be able to use the...
9
by: Alan T | last post by:
Any source code example I can use to save the clipboard content to an object, then I will do a copy and paste, finally put back the 'saved' clipboard content back to clipboard ?
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
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...
0
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
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 ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
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...

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.