c# - 在启用滚动的文本框中禁用版本

标签 c# winforms textbox

我想知道是否可以在不丢失滚动功能的情况下禁用文本框的版本。如果 Enabled 属性设置为 false,则滚动条也会被禁用

最佳答案

尝试:

textBox1.ReadOnly = true;

禁用文本选择:

 ContextMenu blankContextMenu = new ContextMenu();
 textBox1.ContextMenu = blankContextMenu; 

要禁用 Ctrl+C 和 Ctrl+V,请在 KeyDown 事件上捕获它们

关于c# - 在启用滚动的文本框中禁用版本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4546856/

相关文章:

c# - 在 C# 中使用来自服务器资源管理器的数据连接

c# - Windows Mobile 和 UWP 的其他扩展 - 我应该使用哪个版本

c# - IISHttpServer OnDisconnect NullReferenceException

c# - Outlook like 侧边栏并在 Outlook 中显示

javascript - 使用 Javascript 或 jQuery 取消屏蔽文本框密码

c# - MVC View 继承

c# - Windows窗体组合框问题?

C# Winforms : programatically display Button's Hover State

c++ - Win32 API : how to make Edit Text to accept unsigned float only in c++?

wpf - 禁用 WPF 中的按钮?