110,545
社区成员
发帖
与我相关
我的任务
分享
//清空编辑栏
tbDept.Clear();
tbEmail.Clear();
tbPwd.Clear();
tbPwd2.Clear();
tbTel.Clear();
cbIdent.Text = "";
tb_pName.Clear();
UIElementCollection Childrens = this.canvas2.Children;
ClearAllControlContent(Childrens);
private void ClearAllControlContent(UIElementCollection uiControls)
{
foreach (UIElement element in uiControls)
{
if (element is TextBox)
{
(element as TextBox).Text = "";
}
}
}
[/quote]謝謝分享 UIElementCollection Childrens = this.canvas2.Children;
ClearAllControlContent(Childrens);
private void ClearAllControlContent(UIElementCollection uiControls)
{
foreach (UIElement element in uiControls)
{
if (element is TextBox)
{
(element as TextBox).Text = "";
}
}
}