Exemplo n.º 1
0
 public int this[string in_x, string in_y]
 {
     get
     {
         foreach (Control ctrl in Controls)
         {
             if (ctrl is TextBox txtBox)
             {
                 NetUtil.Value cell = (NetUtil.Value)txtBox.Tag;
                 if (cell.NameX == in_x && cell.NameY == in_y)
                 {
                     if (int.TryParse(txtBox.Text, out int value) && value >= 0)
                     {
                         return(value);
                     }
                     else
                     {
                         return(0);
                     }
                 }
             }
         }
         return(0);
     }
 }
Exemplo n.º 2
0
 public TextBox FindCellTextBox(int in_x, int in_y)
 {
     foreach (Control ctrl in Controls)
     {
         if (ctrl is TextBox txtBox)
         {
             NetUtil.Value cell = (NetUtil.Value)txtBox.Tag;
             if (cell.X == in_x && cell.Y == in_y)
             {
                 return(txtBox);
             }
         }
     }
     return(null);
 }
Exemplo n.º 3
0
 void ActiveCellChanged(TextBox in_textBox)
 {
     NetUtil.Value cell = (NetUtil.Value)in_textBox.Tag;
     foreach (Control ctrl in Controls)
     {
         if (ctrl is Label label)
         {
             if (ctrl.Tag is NetUtil.LabelValueX valueX)
             {
                 SwitchLabelFont(label, valueX.X == cell.X);
             }
             else
             {
                 NetUtil.LabelValueY valueY = (NetUtil.LabelValueY)ctrl.Tag;
                 SwitchLabelFont(label, valueY.Y == cell.Y);
             }
         }
     }
 }