Esempio n. 1
0
        private void NeuesAuto_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.Key == Key.N && btnNeu.IsEnabled && (Keyboard.IsKeyDown(Key.LeftCtrl) ||
                                                       Keyboard.IsKeyDown(Key.RightCtrl)))
            {
                btnNeu_Click(sender, e);
            }

            else if (e.Key == Key.S && btnSpeichern.IsEnabled && (Keyboard.IsKeyDown(Key.LeftCtrl) ||
                                                                  Keyboard.IsKeyDown(Key.Right)))
            {
                btnSpeichern_Click(sender, e);
            }

            else if (e.Key == Key.L && btnLoeschen.IsEnabled && (Keyboard.IsKeyDown(Key.LeftCtrl) ||
                                                                 Keyboard.IsKeyDown(Key.Right)))
            {
                btnLoeschen_Click(sender, e);
            }
            else if (e.Key == Key.B && btnAbbrechen.IsEnabled && (Keyboard.IsKeyDown(Key.LeftCtrl) ||
                                                                  Keyboard.IsKeyDown(Key.Right)))
            {
                btnAbbrechen_Click(sender, e);
            }

            else if (e.Key == Key.F1)
            {
                Tastaturkuerzel tastatur = new Tastaturkuerzel();
            }
        }
        private void Listenansicht_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.Key == Key.Space)
            {
                if (datagridliste.SelectedItem != null)
                {
                    Data.Auto auswahl = (Data.Auto)datagridliste.SelectedItem;
                    platzhalter.Content = new NeuesAuto(auswahl.AutoId);
                }
            }

            if (e.Key == Key.F1)
            {
                Tastaturkuerzel tastatur = new Tastaturkuerzel();
            }
        }