Search code examples
gettext

My Clipboard.GetText() not working please help... (Windows Phone)


Why is this not working. i am pasting normal string...

private void button5_Click(object sender, RoutedEventArgs e)
{
    TextBox02.Text = Clipboard.GetText();
}

Solution

  • Clipboard.GetText is not available to Windows Phone applications. MSDN states:

    You cannot get clipboard text from a Windows Phone application, only set it. Calling the GetText method in a Windows Phone application will always cause a SecurityException to occur.

    Reference

    I am not aware of any way to read the clipboard data in Windows Phone.