问题描述
是否可以在不禁用 TextBox 的情况下使 TextBox 中的文本无法选择?这是一个 RichTextBox,我需要它的格式和选择功能.我无法禁用它,因为我想处理 MouseMove 和 MouseDown 事件.
Is it possible to make the text in a TextBox unselectable without disabling the TextBox? It's a RichTextBox and I need it's formatting and selection features. I can't disable it because I want to handle MouseMove and MouseDown events.
到目前为止,我一直在考虑禁用文本框并在其顶部放置一个面板,将其事件委托给文本框处理程序,但我无法使面板透明,因此它隐藏了文本框.
So far I've thought about disabling the Text box and putting a panel on top of it which will delegate it's events to the textbox handlers, but I can't make the panel transparent so it hides the textbox.
谢谢.
推荐答案
如何处理 .Enter 或 .GotFocus 事件以清除所做的任何选择?
您可以在 自动选择所有文本中看到与您想要的相反的内容WinForms TextBox 中的焦点.
What about dealing with the .Enter or .GotFocus events to clear any selection made?
You can see the opposite of what you wanted in Automatically select all text on focus in WinForms TextBox.
这篇关于如何在不禁用的情况下使 WinForms TextBox 中的文本不可选择?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!


大气响应式网络建站服务公司织梦模板
高端大气html5设计公司网站源码
织梦dede网页模板下载素材销售下载站平台(带会员中心带筛选)
财税代理公司注册代理记账网站织梦模板(带手机端)
成人高考自考在职研究生教育机构网站源码(带手机端)
高端HTML5响应式企业集团通用类网站织梦模板(自适应手机端)