如何在文本框中禁用一些文本 [英] how to desable some text in text box

查看:75
本文介绍了如何在文本框中禁用一些文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


请帮帮我.
从加载文本框中的任何文本时,我都有一个文本框,仅应禁用特定文本,如果用户要写新文本,则应写为

Hi,
Please help me out .
i have a text box when from load what ever text in text box the particular text only should be desable and if user want to write new text it should be write

推荐答案

如果我是正确的,那么您正在寻找 Masked C#TextBox控件 [ ^ ].
请参考以下链接:
MaskedTextBox.Mask属性 [演练:使用MaskedTextBox控件 [ MaskedTextBox类 [
If I am correct then you are looking for Masked C# TextBox Control[^].
Refer the links below:
MaskedTextBox.Mask Property [^]
Walkthrough: Working with the MaskedTextBox Control[^]
MaskedTextBox Class[^]


--Amit


如果您想让用户无法修改某些文本的文本框,只需将其添加到末尾(或类似内容),则该文本框就不好了选择-它不能开箱即用,添加该功能将是笨拙".

但是,有
MaskedTextBox [
If you mean that you want a text box where the user cannot modify some of the text, just add to the end (or similar) then the text box is not a good choice - it can''t do it out of the box, and it would be "clumsy" to add that functionality.

However, there is the MaskedTextBox[^] which can: look at the Mask property.

For example, setting the Mask to "FIXED TEXT: AAAAA : MORE" means that the user can enter only 5 alphanumeric characters, which will always be in the area between the '':'' characters.


这篇关于如何在文本框中禁用一些文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆