在代码中控制控件的属性 [英] controlling properties of controls in a code

查看:94
本文介绍了在代码中控制控件的属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Web表单上大约有10个文本框,我希望能够通过功能控制其属性,例如enable,bisible等.


God Hath Done!

i av about 10 textboxxes on a web form i want to be able to control thier properties like enable,bisible etc from a function


What God Hath Done!

推荐答案

然后,您应该给文本框起一个名字,例如,例如textBox1(实际上是默认值).然后,您可以使用此代码:

Then you should give the textboxes a name, for examepl textBox1 (which is actually the default). Then, you can use this:

public void MyFunction()
{
    // Modify properties
    textBox1.Enabled = false;
}


这篇关于在代码中控制控件的属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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