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![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
8
}
9
}
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
2
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif)
3
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
4
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
5
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
6
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
7
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
8
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
9
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockEnd.gif)