public void TbClear() { ShTextBox.Clear(); ArtTextBox.Clear(); NameTextBox.Clear(); CountTextBox.Clear(); comboBox1.SelectedIndex = -1; }
private void Form1_KeyDown(object sender, KeyEventArgs e) { if (e.Control && e.KeyCode == Keys.Enter) // Ctrl-Enter Add { AddButton.PerformClick(); e.SuppressKeyPress = true; // Stops other controls on the form receiving event. } if (e.KeyCode == Keys.F1) // F1 фокус окна фирмы { comboBox1.Focus(); e.SuppressKeyPress = true; // Stops other controls on the form receiving event. } if (e.KeyCode == Keys.F2) // F2 фокус окна штрихкода { ShTextBox.Focus(); e.SuppressKeyPress = true; // Stops other controls on the form receiving event. } if (e.KeyCode == Keys.F3) // F3 фокус окна артикула { ArtTextBox.Focus(); e.SuppressKeyPress = true; // Stops other controls on the form receiving event. } if (e.KeyCode == Keys.F4) // F4 фокус окна наименования { NameTextBox.Focus(); e.SuppressKeyPress = true; // Stops other controls on the form receiving event. } if (e.KeyCode == Keys.F5) // F5 фокус окна количества { LoadXML(); e.SuppressKeyPress = true; // Stops other controls on the form receiving event. } if (e.Control && e.KeyCode == Keys.S) // Ctrl-S Save Prices { SavePriceButton.PerformClick(); e.SuppressKeyPress = true; // Stops other controls on the form receiving event. } }