Catching Ctrl + C in a textbox

后端 未结 8 1744
孤城傲影
孤城傲影 2020-12-15 20:42

Despite me working with C# (Windows Forms) for years, I\'m having a brain fail moment, and can\'t for the life of me figure out how to catch a user typing Ctrl +

8条回答
  •  心在旅途
    2020-12-15 21:11

    Try the following: capture the up arrow and down arrow events. When you detect down arrow for CTRL, set a flag; when you detect up arrow, reset the flag. If you detect the C key while the flag is set, you have Ctrl+C.

    Edit. Ouch... Jay's answer is definitely better. :-)

提交回复
热议问题