Difference between the KeyDown Event, KeyPress Event and KeyUp Event in Visual Studio

前端 未结 5 522
小蘑菇
小蘑菇 2020-11-29 03:36

Can anyone tell me the difference between the KeyDown event, the KeyPress event and the KeyUp event? I checked the msdn site and it do

5条回答
  •  执笔经年
    2020-11-29 04:05

    • KeyDown: happens when the person presses a key (when the keyboard first detects a finger on a key, this happens when the key is pressed down).

    • KeyPress: happens when a key is pressed and then released.

    • KeyUp: happens when the key is released

    You are right that all of these events occur when a key is pressed and then released, in the order I described above.

提交回复
热议问题