XBAP 选择页面文本
接管了一个XBAP浏览器应用程序。对于某些剪贴板操作,选择 XBAP 而不是 HTML,并且该应用程序受到好评。
最近,一位用户询问为什么他不能像常规 HTML 页面一样选择屏幕文本(并复制到剪贴板)。哇,没有看到这一点,但完全明白它们来自哪里。
XBAP 应用程序有许多带有标签和信息文本块的表单。用户需要选择并复制该文本。
我有什么选择吗?我不想将数据移动到文本框。
Took over an XBAP browser application. XBAP was chosen over HTML for some clipboard actions, and the application was well received.
Recently a user asked why he cannot select screen text (and copy to clipboard) like a regular HTML page. Wow, didn't see that coming, but totally understand where they are coming from.
The XBAP application has many forms that have labels and textblocks of information. The user needs to select and copy this text.
Do I have any options? I don't want to move the data to textboxes.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
AFAIK,您无法选择标签/文本块。这是一个古老的 Windows UI 传统。
您可以 样式文本框(如标签):
或者您可以将部分 UI 更改为 WebBrowser 控件并为其提供正确的 HTML。在这种情况下,您会丢失细粒度的数据绑定,每次数据更改时都必须重新加载整个页面,并且它可能并不适合所有场景。但通常某些“报告”部分需要复制/粘贴,然后您可以以 HTML 格式制作此报告......
HTH。
我自己也想知道更好的方法=(
AFAIK, you can't make labels/textblocks selectable. It's an old Windows UI tradition.
You can either style textboxes like labels:
or you can change part of your UI to the WebBrowser control and provide it with proper HTML. You lose fine-grained data bindings in that case, you'll have to reload that whole page on every data change, and it might not be suitable for every scenario. But usually copy/paste is needed for some "reporting" part, then you can make this report in the HTML format...
HTH.
I'd like to know better ways myself =(