Autor Beitrag
tartare
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 89

Win XP SP2, WIN Vista Home Professional
Delphi 7/2009, C#, C++(VS 2005 Express)
BeitragVerfasst: Mi 14.02.07 00:31 
Hallo,

ich möchte wenn ich in einem listview auf entfernen drücke einen Eintrag löschen:

ausblenden C#-Quelltext
1:
2:
3:
4:
5:
    private void liste_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (e.KeyChar == (char)Keys.Delete) Loeschen_Click(Loeschen, e);
            if (e.KeyChar == (char)Keys.Enter) Abspielen_Click(Abspielen, e);
        }


doch geht er beim drücken der taste nicht einmal in die funktion, doch wenn ich z.bsp. enter drücke schon. Woran kann das liegen?

Danke im Vorraus

_________________
Ich leb in meiner eigenen Welt, aber das is ok, da kennt man mich.
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 14.02.07 00:55 
IIRC werden einige Tasten nur durch KeyUp und KeyDown erkannt und nicht durch KeyPress.

_________________
Zwei Worte werden Dir im Leben viele Türen öffnen - "ziehen" und "drücken".
tartare Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 89

Win XP SP2, WIN Vista Home Professional
Delphi 7/2009, C#, C++(VS 2005 Express)
BeitragVerfasst: Mi 14.02.07 20:25 
Danke, funktioniert jetzt wunderbar im keydown ereignis.

_________________
Ich leb in meiner eigenen Welt, aber das is ok, da kennt man mich.