Beispiel #1
0
 private void FromTextBox_KeyPress(object sender, KeyPressEventArgs e)
 {
     if (e.KeyChar == (char)Keys.Return)
     {
         AddButton.PerformClick();
     }
 }
Beispiel #2
0
 private void ContentTextBox_KeyPress(object sender, KeyPressEventArgs e)
 {
     if (e.KeyChar == '\n' && ModifierKeys == Keys.Control)
     {
         AddButton.PerformClick();
         e.Handled = true;
     }
 }
Beispiel #3
0
 private void stockOutQuantityTextBox_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Enter)
     {
         AddButton.PerformClick();
         e.SuppressKeyPress = true;
         itemComboBox.Focus();
     }
 }
Beispiel #4
0
        private void TodoBox_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
            {
                AddButton.PerformClick();

                e.Handled          = true;
                e.SuppressKeyPress = true;
            }
        }
Beispiel #5
0
        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.
            }
        }
Beispiel #6
0
        // Calculator_KeyPress: Checks for user input through KeyPresses and performs
        // the corresponding Click-event for the appropriate button.
        // Pre: -
        // Post: The KeyPress-event has been handled and, if there's a match, the appropriate
        // buttons Click-event has been fired.
        private void Calculator_KeyPress(object sender, KeyPressEventArgs e)
        {
            switch (e.KeyChar)
            {
            case '1': OneButton.PerformClick(); break;

            case '2': TwoButton.PerformClick(); break;

            case '3': ThreeButton.PerformClick(); break;

            case '4': FourButton.PerformClick(); break;

            case '5': FiveButton.PerformClick(); break;

            case '6': SixButton.PerformClick(); break;

            case '7': SevenButton.PerformClick(); break;

            case '8': EightButton.PerformClick(); break;

            case '9': NineButton.PerformClick(); break;

            case '0': ZeroButton.PerformClick(); break;

            case '/': DivideButton.PerformClick(); break;

            case '*': MultiplyButton.PerformClick(); break;

            case '-': SubtractButton.PerformClick(); break;

            case '+': AddButton.PerformClick(); break;

            case ',': CommaButton.PerformClick(); break;

            case 'C': ClearButton.PerformClick(); break;

            case 'c': ClearButton.PerformClick(); break;
            }
            e.Handled = true;
        }
Beispiel #7
0
 private void AddAndCloseButton_Click(object sender, EventArgs e)
 {
     AddButton.PerformClick();
     CloseButton.PerformClick();
 }