新的 WP7 剪切和粘贴功能可以以编程方式使用吗? [英] Can the new WP7 cut and paste functionality be used programmatically?

查看:24
本文介绍了新的 WP7 剪切和粘贴功能可以以编程方式使用吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Windows Phone 开发人员工具的新(2011 年 1 月)更新添加了对剪切和粘贴的支持,这是否可以在代码中以编程方式使用?

As the new (January 2011) Update to the Windows Phone Developer Tools adds support for Cut and Paste, can this be used programmatically in code?

推荐答案

没有

2011 年 1 月的更新不包括对剪贴板(或任何新 API)的编程访问.剪贴板只能由用户访问以剪切和粘贴文本.是的,只能剪切、复制和粘贴文本.

The January 2011 update does not include programatic access to the clipboard (or any new APIs). The clipboard can only be accessed by the user to cut and paste text. Yes, only text can be cut, copied and pasted.

剪切和粘贴功能已添加到所有文本框,当在更新的模拟器或已应用更新的设备上运行时,应用程序中的文本框将自动获得此功能.即使您将文本框设为只读,这也适用.

Cut and paste functionality has been added to all textboxes and textboxes within your application will automatically get this ability when run on the updated emulator or a device which has had the update applied. This applies even if you make the textbox readonly.

如果您在 Pivot 或 Panorama 中使用文本框(指南不建议这样做),您应该检查您的应用是否存在该区域的任何可能问题.(用手指滑动以扩大所选区域可能会导致枢轴或全景图滑动.您可能不希望这样.)

If you are using a textbox within a Pivot or Panorama (which the guidelines advise against) you should review your app with regard to any possible problems in this area. (Sliding with a finger to expand the selected area may cause the pivot or panorama to slide. You probably don't want this.)

芒果更新

Mango (v7.1) 引入了对 剪贴板 但仅用于设置文本,不获取任何已经存在的文本.

Mango (v7.1) introduces programmatic access to the Clipboard but only for setting text, not getting any text which is already there.

来自 MSDN:

您无法从 Windows Phone 应用程序获取剪贴板文本,只能设置它.在 Windows Phone 应用程序中调用 GetText 方法将总是导致发生 SecurityException."

"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."

这篇关于新的 WP7 剪切和粘贴功能可以以编程方式使用吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆