如何做文本框不可编辑但可读形式 [英] how to do textbox NOT Editable but Readable in form
本文介绍了如何做文本框不可编辑但可读形式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
我有文本框,并且要使该文本不要编辑但是可读。请使用exp
hi all,
i've text box and to make that text not to edit but be readable.please reply with an exp
推荐答案
设置文本框的属性
ReadOnly = True
i希望这可能帮助你。
set the propery of the text box
ReadOnly=True
i hope this may help you.
将readonly属性设置为True。
或将此代码粘贴到您的表单上:
Set the readonly property to True.
or paste this code on your form:
//private void Form1_Load(object sender, EventArgs e)
//{
textBox1.ReadOnly = true;
//}
您可以使用Textbox的Readonly或Enabled属性来实现此目的
You can use the Readonly or Enabled property of Textbox for this purpose
txtBox1.ReadOnly=true;
- 或 -
-or -
txtBox1.Enabled=false;
你可以设置这也来自设计层面
You can set this from the Design level also
这篇关于如何做文本框不可编辑但可读形式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文