473,791 Members | 3,277 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.SetDa taObject(templa te)

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 6527
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.SetDa taObject(templa te, True)

Kerry Moorman

"MARTIN LANNY" wrote:
This is how I setup clipboard in my application:

dim template as string = "put to clipboard"
Clipboard.SetDa taObject(templa te)

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.SetDa taObject(templa te, 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
1990
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 VB.NET there is no image control for one and I get a type cast error while trying to save the contents of the clipboard using GetData() as an image Any help on this? VBUser
1
1831
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...
6
3011
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 the table is still selected, as if to be copied or cut. It just looks ugly. I've seen some IE-only solutions, but none for FF.
1
3246
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
7
1804
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, Edit & PasteSpecial, there is a label called "Source:" which will contain the file path, etc. How can one obtain the source file reference material utilizing .Net
6
7146
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) { Object item = (object)e.Data.GetData(typeof(AbstractNode)); // Other code }
2
3265
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 DataObject() data.SetData(DataFormats.UnicodeText, True, value) Clipboard.SetDataObject(data,True) End Sub When I test it, I get an exception:
2
9651
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
2879
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, Formatter.Serialize(StreamTemp, dbObject); //but it can't be Serialized, StreamTemp.Close(); Return StreamTemp.GetBuffer() ;
0
9669
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
9517
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
10207
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...
1
10156
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7537
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
6776
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5435
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...
2
3718
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2916
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.