我想用一个文本框来显示一些文本。我无法禁用它,因为那样滚动条将不起作用。
如何防止在多行文本框内进行编辑,同时使其看起来好像已启用,以便滚动条正常工作?
最佳答案
您可以设置 ReadOnly property为真。
引用链接:
When this property is set to true, the contents of the control cannot be changed by the user at runtime. With this property set to true, you can still set the value of the Text property in code. You can use this feature instead of disabling the control with the Enabled property to allow the contents to be copied and ToolTips to be shown.
关于c# - 如何禁止编辑文本框?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8330430/