Autor Beitrag
erfahrener Neuling
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 233
Erhaltene Danke: 19

Win 7, Win 10
C#, ASP-MVC (VS 2017 Community), MS SQL, Firebird SQL
BeitragVerfasst: Mi 06.04.16 13:45 
Hallo,

ich möchte die Tastenkombination STRG + R abfangen.
Das hier funktioniert nicht
ausblenden C#-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
if (e.KeyCode == (Keys.Control | Keys.R))
{
  //funktioniert nicht
}

if (e.KeyCode == (Keys.Control & Keys.R))
{
       //funzt auch nicht
}
Bitte um schnelle und einfache Hilfe.

Danke im Vorraus!
Christian S.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 20451
Erhaltene Danke: 2264

Win 10
C# (VS 2019)
BeitragVerfasst: Mi 06.04.16 13:47 
Schau Dir nochmal die Eigenschaften des Parameters e an ;-)

_________________
Zwei Worte werden Dir im Leben viele Türen öffnen - "ziehen" und "drücken".

Für diesen Beitrag haben gedankt: erfahrener Neuling
erfahrener Neuling Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 233
Erhaltene Danke: 19

Win 7, Win 10
C#, ASP-MVC (VS 2017 Community), MS SQL, Firebird SQL
BeitragVerfasst: Mi 06.04.16 13:52 
Ok danke mal wieder :)

Die richtige Lösung war jetzt
ausblenden C#-Quelltext
1:
if (e.Control & e.KeyCode == Keys.R) {}					
Das hatte ich vorhin auch schon, aber da hatte ich die KeyPreview noch auf false.

Wieder was neues dazu gelernt :zustimm: