from中一次性清空多个文本框

在from中将多个文本框里的数据添加到数据库后,需要将全部清空代码

1        private void bt_cancel_Click(object sender, EventArgs e)
2        {//清空所有文本框的值
3            for (int i = 0; i < Controls.Count; i++)
4            {
5                if (Controls[i] is TextBox)
6                    Controls[i].Text = "";
7
8            }

9        }
posted @ 2008-12-13 09:52  kaka9  阅读(426)  评论(0编辑  收藏  举报