469,927 Members | 1,836 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,927 developers. It's quick & easy.

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 6353
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by VB User | last post: by
1 post views Thread by Nukeation | last post: by
6 posts views Thread by jonathon | last post: by
1 post views Thread by keith | last post: by
2 posts views Thread by yxq | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.