ClipboardProxy Class
Provides methods for manipulating the Clipboard.
Assembly: Microsoft.VisualBasic (in Microsoft.VisualBasic.dll)
The ClipboardProxy type exposes the following members.
| Name | Description | |
|---|---|---|
![]() | Clear | Clears the Clipboard. |
![]() | ContainsAudio | Indicates whether the Clipboard contains audio data. |
![]() | ContainsData | Indicates whether the Clipboard contains data in the specified custom format. |
![]() | ContainsFileDropList | Returns a Boolean indicating whether the Clipboard contains a file drop list. |
![]() | ContainsImage | Returns a Boolean indicating whether an image is stored on the Clipboard. |
![]() | ContainsText() | Determines if there is text on the Clipboard. |
![]() | ContainsText(TextDataFormat) | Determines if there is text on the Clipboard. |
![]() | Equals(Object) | Determines whether the specified Object is equal to the current Object. (Inherited from Object.) |
![]() | Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) |
![]() | GetAudioStream | Retrieves an audio stream from the Clipboard. |
![]() | GetData | Retrieves data in a custom format from the Clipboard. |
![]() | GetDataObject | Retrieves data from the Clipboard as an IDataObject. |
![]() | GetFileDropList | Retrieves a collection of strings representing file names from the Clipboard. |
![]() | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) |
![]() | GetImage | Retrieves an image from the Clipboard. |
![]() | GetText() | Retrieves text from the Clipboard. |
![]() | GetText(TextDataFormat) | Retrieves text from the Clipboard. |
![]() | GetType | Gets the Type of the current instance. (Inherited from Object.) |
![]() | MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) |
![]() | SetAudio(array<Byte>) | Writes audio data to the Clipboard. |
![]() | SetAudio(Stream) | Writes audio data to the Clipboard. |
![]() | SetData | Writes data in a custom format to the Clipboard. |
![]() | SetDataObject | Writes a DataObject to the Clipboard. |
![]() | SetFileDropList | Writes a collection of strings representing file paths to the Clipboard. |
![]() | SetImage | Writes an image to the Clipboard. |
![]() | SetText(String) | Writes text to the Clipboard. |
![]() | SetText(String, TextDataFormat) | Writes text to the Clipboard. |
![]() | ToString | Returns a string that represents the current object. (Inherited from Object.) |
Items moved or copied to the Clipboard persist even after the application is shut down.
Data on the Clipboard can be in any data format, also called a Clipboard format. For a list of predefined formats to use with the Clipboard, see DataFormats. When an item is moved or copied to the Clipboard, items in other formats are cleared. To make other formats persist, use DataObject, which copies everything existing on the current Clipboard, including items pasted from other applications. Place data on the Clipboard in multiple formats to maximize the possibility that a target application, whose format requirements you might not know, can successfully retrieve the data.
Because all Windows applications share the system Clipboard, the contents may change when you switch to another application.
A class must be serializable for it to be put on the Clipboard. See Serialization (C# and Visual Basic) for more information.
When accessing the Clipboard remotely, a ThreadStateException is thrown unless the accessing thread operates in STA (single-threaded apartment) mode. To resolve this issue, set the ThreadApartmentState to STA. For more information, see STAThreadAttribute.
The following table lists examples of tasks involving the My.Computer.Clipboard object.
To | See |
|---|---|
Clear the Clipboard | |
Read from the Clipboard | |
Find out what is stored on the Clipboard | How to: Determine What Type of File is Stored on the Clipboard in Visual Basic |
Save audio to the Clipboard | How to: Save an Audio Stream to the Clipboard in Visual Basic |
Get an image from the Clipboard | How to: Retrieve an Image from the Clipboard in Visual Basic |
Store data to the Clipboard |
Availability by Project Type
Project type | Available |
|---|---|
Windows Application | Yes |
Class Library | Yes |
Console Application | Yes |
Windows Control Library | Yes |
Web Control Library | No |
Windows Service | Yes |
Web Site | No |
Note |
|---|
The HostProtectionAttribute attribute applied to this type or member has the following Resources property value: Resources. The HostProtectionAttribute does not affect desktop applications (which are typically started by double-clicking an icon, typing a command, or entering a URL in a browser). For more information, see the HostProtectionAttribute class or SQL Server Programming and Host Protection Attributes. |
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
