Clipboard.SetText Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Stores text data on the Clipboard. The text data to store is specified as a string.
Overloads
SetText(String) |
Stores UnicodeText data on the Clipboard. |
SetText(String, TextDataFormat) |
Stores text data on the Clipboard in a specified text data format. The UnicodeText data to store is specified as a string. |
SetText(String)
Stores UnicodeText data on the Clipboard.
public:
static void SetText(System::String ^ text);
public static void SetText (string text);
static member SetText : string -> unit
Public Shared Sub SetText (text As String)
Parameters
- text
- String
A string that contains the UnicodeText data to store on the Clipboard.
Exceptions
text
is null
.
Remarks
This data format denotes 16-bit character encoded Unicode, also referred to as UTF-16, and UCS-2.
This method adds data with auto-conversion disabled.
See also
- SetAudio
- SetData(String, Object)
- SetDataObject
- SetFileDropList(StringCollection)
- SetImage(BitmapSource)
- ContainsText
- GetImage()
- DataFormats
Applies to
SetText(String, TextDataFormat)
Stores text data on the Clipboard in a specified text data format. The UnicodeText data to store is specified as a string.
public:
static void SetText(System::String ^ text, System::Windows::TextDataFormat format);
public static void SetText (string text, System.Windows.TextDataFormat format);
static member SetText : string * System.Windows.TextDataFormat -> unit
Public Shared Sub SetText (text As String, format As TextDataFormat)
Parameters
- text
- String
A string that contains the text data to store on the Clipboard.
- format
- TextDataFormat
A member of TextDataFormat that specifies the specific text data format to store.
Exceptions
text
is null
.
Remarks
This method adds data with auto-conversion disabled.
See also
- SetAudio
- SetData(String, Object)
- SetDataObject
- SetFileDropList(StringCollection)
- SetImage(BitmapSource)
- ContainsText
- GetImage()
- DataFormats