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); } }
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); }
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); } } } }