textBox

//获取textbox的名字
    textbox.name.subString(0,textbox.name.ToStrin().Lenght-1);

//form内遍历所有的textbox控件
protected void Page_Load(object sender, EventArgs e)
    {
        foreach (Control item in form1.Controls)
        {
            if (item is TextBox)
            {
                ((TextBox)item).ReadOnly = true;
            }
        }
    }

 

 

posted @ 2014-11-15 18:46  躯壳123  阅读(181)  评论(0编辑  收藏  举报