Пример #1
0
        // Opens related form on key press
        private void OpenFormsOnKeyPress(object sender, KeyPressEventArgs e)
        {
            var key = e.KeyChar;

            switch (key)
            {
            case 'a':
                Form addQuoteForm = new AddQuote();
                addQuoteForm.ShowDialog();
                break;

            case 'v':
                Form viewQuotesForm = new ViewAllQuotes();
                viewQuotesForm.ShowDialog();
                break;

            case 's':
                Form searchQuotesForm = new SearchQuotes();
                searchQuotesForm.ShowDialog();
                break;

            case 'x':
                Application.Exit();
                break;
            }

            // Prevents event from firing multiple times
            e.Handled = true;
        }
Пример #2
0
        private void SearchQuotesButton_Click(object sender, EventArgs e)
        {
            this.Hide();
            SearchQuotes sq = new SearchQuotes();

            sq.ShowDialog();
            this.Close();
        }
Пример #3
0
        private void bttnSearchQuotes_Click(object sender, EventArgs e)
        {
            SearchQuotes SearchQuotes = new SearchQuotes();

            SearchQuotes.ShowDialog();
        }
Пример #4
0
        // Opens Search Quotes form on button click
        private void SearchQuotes_Click(object sender, EventArgs e)
        {
            Form searchQuotesForm = new SearchQuotes();

            searchQuotesForm.ShowDialog();
        }