How to programmatically copy/paste in windows phone? [duplicate]

不羁的心 提交于 2019-12-19 05:18:40

问题


Possible Duplicate:
Can the new WP7 cut and paste functionality be used programatically?

Is there a way to programmatically copy/paste text in windows phone. I want the user to click on a button that should automatically copy some text to the clipboard. The text resides on a TextBlock control (which may be hidden). The only workaround that I have thought of is to pop a dialog with the text filled in in a TextBlock (which natively supports copy paste).

Thoughts?


回答1:


To set text : Clipboard.SetText("foo-bar")

To check if clipboard contains text : Clipboard.ContainsText("foo-bar")

No method to to get text Clipboard.GetText() results in Security Exception



来源:https://stackoverflow.com/questions/5761798/how-to-programmatically-copy-paste-in-windows-phone

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!