static public void change_() { js = LCD.CurrentCell.RowIndex; tex.TextBox.Invoke((MethodInvoker)(() => tex.TextBox.Text = js.ToString())); string ks = tex.TextBox.Text; int row_ind = int.Parse(ks); int select = LCD.CurrentCell.RowIndex; row_ind--; if (row_ind == 0 || row_ind <= 0) { row_ind = 0; } LCD.Invoke((MethodInvoker)(() => LCD.CurrentCell = LCD.Rows[row_ind].Cells[1])); LCD.Rows[select].Selected = false; LCD.Rows[row_ind].Selected = true; string nm = LCD.Rows[row_ind].Cells[1].Value.ToString(); string fn = LCD.Rows[row_ind].Cells[2].Value.ToString(); string ln = LCD.Rows[row_ind].Cells[3].Value.ToString(); string N = LCD.Rows[row_ind].Cells[4].Value.ToString(); Name.Invoke((MethodInvoker)(() => Name.Text = nm)); FirstN.Invoke((MethodInvoker)(() => FirstN.Text = fn)); LastN.Invoke((MethodInvoker)(() => LastN.Text = ln)); number.Invoke((MethodInvoker)(() => number.Text = N)); }
static public void ChangePlus() { try { js = LCD.CurrentCell.RowIndex; js += 2; tex.TextBox.Invoke((MethodInvoker)(() => tex.TextBox.Text = js.ToString())); string ks = tex.TextBox.Text; int row_ind = int.Parse(ks); int select = LCD.CurrentCell.RowIndex; row_ind--; LCD.Invoke((MethodInvoker)(() => LCD.CurrentCell = LCD.Rows[row_ind].Cells[1])); LCD.Rows[select].Selected = false; LCD.Rows[row_ind].Selected = true; string nm = LCD.Rows[row_ind].Cells[1].Value.ToString(); string fn = LCD.Rows[row_ind].Cells[2].Value.ToString(); string ln = LCD.Rows[row_ind].Cells[3].Value.ToString(); string N = LCD.Rows[row_ind].Cells[4].Value.ToString(); Name.Invoke((MethodInvoker)(() => Name.Text = nm)); FirstN.Invoke((MethodInvoker)(() => FirstN.Text = fn)); LastN.Invoke((MethodInvoker)(() => LastN.Text = ln)); number.Invoke((MethodInvoker)(() => number.Text = N)); } catch { MessageBox.Show("Впереди никого нет"); } }