简体   繁体   English

为什么我的文本框在tabcontrol中处于只读模式?

[英]Why is my textbox in readonly Mode in tabcontrol?

I'm working with .net framework 4.0 ، Visual Studio 2010 and writing in c#. 我正在使用.net Framework 4.0和Visual Studio 2010并用c#编写。 in my windows form application i have a tabcontrol called tablcontrol1 and within that i have a textbox called txt_name. 在我的Windows窗体应用程序中,我有一个名为tablcontrol1的tabcontrol,在其中有一个名为txt_name的文本框。
in txt_name property i didn't set the ReadOnly attribute to true. 在txt_name属性中,我没有将ReadOnly属性设置为true。 but when i start the application the txt_name which is within the tabcontrol1 is some kind of ReadOnly : 但是当我启动应用程序时,位于tabcontrol1内的txt_name是某种ReadOnly:
i mean it's value can't be changed and it's background-color is grey just like a ReadOnly textbox and when i put the txt_name outside of the tabcontrol1 : it is fixed and it's not in ReadOnly mood so i guess the main problem is with the tabcontrol1. 我的意思是它的值无法更改,它的背景色是灰色的,就像一个ReadOnly文本框一样,当我将txt_name放在tabcontrol1之外时:它是固定的,并且它不在ReadOnly气氛中,所以我想主要的问题是tabcontrol1。
I searcher a lot but i don't what should i do with that! 我搜寻了很多东西,但是我不应该怎么做!

Try to check [Enabled] property 尝试检查[Enabled]属性
also controls.Enable like the below 也可以控制。如下所示启用

 foreach (Control ctl in tablcontrol1.Controls) ctl.Enabled = true;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM