473,395 Members | 1,658 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,395 software developers and data experts.

VB.NET - How do I set and keep data in the clipboard?

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 as the program is closed I lose the clipboard as well.

Is there any way to keep the data in clipboard even that my application
is already closed?

Please let me know, this is crucial for my software functionality and I
spent lot of time already trying to figure it out.

Martin

Feb 6 '06 #1
4 6505
Martin,

There is an overloaded version of SetDataObject that lets you specify
whether or not the data should remain in the clipboard after your app closes:

Clipboard.SetDataObject(template, True)

Kerry Moorman

"MARTIN LANNY" wrote:
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 as the program is closed I lose the clipboard as well.

Is there any way to keep the data in clipboard even that my application
is already closed?

Please let me know, this is crucial for my software functionality and I
spent lot of time already trying to figure it out.

Martin

Feb 6 '06 #2
jvb
Clipboard.SetDataObject(template, True)

Feb 6 '06 #3
Ah, this would be way too easy. Let me try it out.
Thanks.
Martin

Feb 6 '06 #4
jvb
It is that easy...from ms help

Parameters
data
The data to place on the clipboard.
copy
true if you want data to remain on the clipboard after this application
exits; otherwise, false.

Feb 6 '06 #5

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

Similar topics

1
by: VB User | last post by:
Earlier in VB6, the image was copied onto the clipboard from the Image Processing Program . This image would then be loaded onto the image control on the VB form using GetData() function. In...
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...
6
by: jonathon | last post by:
I have a table of line-style entries, much like webmail. When the user double-clicks on a line, a box pops up to enter the data for that entry. The problem is, whatever word they clicked on in...
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...
7
by: TC | last post by:
Hello, I am familiar with obtaining source file reference material from the system clipboard using the old Win32 API. For example, copy an Excel chart onto the clipboard and goto Word. Under,...
6
by: Andy | last post by:
I'm making a drag and drop application, and in the *_DragDrop(...)-method I have the following code: private void SelectTree_DragDrop(object sender, System.Windows.Forms.DragEventArgs e) {...
2
by: Shayne H | last post by:
I am trying to write a method to copy some text to the clipboard, and leave a copy of it there after the application has exited. Sub CopyToClipboard(ByVal value As Object) Dim data As New...
2
by: yxq | last post by:
Hello I want to get Windows clipboard data size, seem to use the function "GetClipboardDataSize". Could anyone please tell how to do using vb.net? Thanks
5
by: cgd | last post by:
hi, i want to save the MS Word data (not the Word file) to a database, so i copy the Word data to clipboard first,and then get the data to a DataObject object, and then try the code below, ...
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:
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
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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...
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...

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.