zl程序教程

您现在的位置是:首页 >  后端

当前栏目

wpf 遍历控件及其值

WPF遍历 控件 及其
2023-09-14 09:07:45 时间

private void SetNotEditable(UIElementCollection uiControls)

 {          
     foreach (UIElement element in uiControls)
     {
         if (element is TextBox)
         {
             TextBox txtBox = (element as TextBox);                 
         }
         else if (element is Grid)
         {
             this.SetNotEditable((element as Grid).Children);
         }
     }
}