private void textBox_proc1value_KeyDown(object sender, KeyEventArgs e) { Keys key = e.KeyCode; if (e.Control!=true)//如果没按Ctrl键 return; TextBox textBox = sender as TextBox; switch (key) { case Keys.Up: textBox.Text = (int.Parse(textBox.Text.Trim()) + 1).ToString(); break; case Keys.Down: textBox.Text = (int.Parse(textBox.Text.Trim()) - 1).ToString(); break; } }
时间: 2024-10-10 16:32:58