How to Set Clipboard text (Copy Paste) programmatically in Windows Phone ?

If you have to set the Clipboard text programmatically in your Windows Phone, you can use the Clipboard Class that is defined in the System.Windows Namespace.

Clipboard is a static class that exposes 3 properties

1. ContainsText

2. GetText

3. SetText

How to Set Clipboard text (Copy Paste) programmatically in Windows Phone ?

You can use the Clipboard.SetText to set the text for the clipboard .

Clipboard.SetText("www.developerpublish.com");

There is also a restriction to use the Clipboard.GetText which results in the SecurityException.

To test if the Clipboard has the value that you set, just paste the data to a textbox after using the Clipboard.SetText

Leave A Reply

Your email address will not be published. Required fields are marked *

You May Also Like

In this post, you’ll learn about the Win32 Error “0x000019E5 – ERROR_COULD_NOT_RESIZE_LOG” that you get when debugging system erors in...
In this post, you’ll learn about the error “CO_E_DBERROR 0x8004E02B” that is returned when working with COM based APIs or...
In this post, you’ll learn about the Win32 Error “0x000019D0 – ERROR_LOG_BLOCK_VERSION” that you get when debugging system erors in...