문제

I couldnt catch ctrl+space key event in winForm.But i wrote this code ((e.KeyCode==Keys.Space)&&(e.Modifiers==Keys.Control)) it didnt work.What is the problem?

[EDIT]sorry.problem is in another thing.It works.

도움이 되었습니까?

해결책

Try (e.Modifiers & Keys.Control == Keys.Control) instead of (e.Modifiers==Keys.Control)

다른 팁

Here is my suggestion:

if (e.KeyData.HasFlag(Keys.Space) && e.KeyData.HasFlag(Keys.Control))
{
    // DoSomething
}
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top