Exemple #1
0
 public Form1()
 {
     InitializeComponent();
     foreach (Control item in MainPanel.Controls)
     {
         if (item is TextBox)
         {
             item.Click     += text.Click;
             item.LostFocus += text.LostFocus;
             text.Add((TextBox)item);
         }
     }
 }
Exemple #2
0
        public SetFunction()
        {
            InitializeComponent();
            ReturnButton.DialogResult = DialogResult.OK;
            TextBoxWork boxWork = new TextBoxWork();

            foreach (Control item in MainPanel.Controls)
            {
                if (item is TextBox control)
                {
                    control.Click     += boxWork.Click;
                    control.LostFocus += boxWork.LostFocus;
                    boxWork.Add(control);
                }
            }
        }