How to Set WinForms Textbox to overwrite mode(如何将 WinForms 文本框设置为覆盖模式)
问题描述
是否可以强制 Windows 窗体应用程序中的文本框在覆盖模式"下工作,即在用户键入而不是添加时替换字符?
否则,有没有标准的方法来获得这种行为?
Is it possible to force a textbox in a windows forms application to work in "overwrite mode", i.e. have characters replaced when the user types instead of added?
Otherwise, is there a standard way to get this behavior?
推荐答案
尝试使用 MaskedTextBox 并将 InsertKeyMode 设置为 InsertKeyMode.Overwrite.
Try using a MaskedTextBox and set InsertKeyMode to InsertKeyMode.Overwrite.
MaskedTextBox box = ...;
box.InsertKeyMode = InsertKeyMode.Overwrite;
这篇关于如何将 WinForms 文本框设置为覆盖模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何将 WinForms 文本框设置为覆盖模式


- Azure Active Directory 与 MVC,客户端和资源标识同一 2022-01-01
- C# 通过连接字符串检索正确的 DbConnection 对象 2022-01-01
- 在 C# 中异步处理项目队列 2022-01-01
- 在 LINQ to SQL 中使用 contains() 2022-01-01
- CanBeNull和ReSharper-将其用于异步任务? 2022-01-01
- 带问号的 nvarchar 列结果 2022-01-01
- 使用 rss + c# 2022-01-01
- 为什么 C# 中的堆栈大小正好是 1 MB? 2022-01-01
- 是否可以在 .Net 3.5 中进行通用控件? 2022-01-01
- Windows 喜欢在 LINUX 中使用 MONO 进行服务开发? 2022-01-01