C# 窗体中遍历文本框

foreach (Control control in ctls)
50             {
51                 if (control is TextBox)
52                 {
53                     (control as TextBox).Enter += new EventHandler(SetTextBoxOnEnterStyle);
54                     (control as TextBox).Leave += new EventHandler(SetTextBoxOnLeaveStyle);
55                 }
56 
57                 if (control.Controls.Count > 0)
58                 {
59                     IterateControlsSetTextBox(control.Controls);
60                 }
61             }

 

posted @ 2020-06-16 17:38  风神凤凰  阅读(595)  评论(0)    收藏  举报