WM_KEYDOWN does not get arrow key messages

  • Thread starter Thread starter Just Me
  • Start date Start date
J

Just Me

I have two situations:

1) a form with a picturebox on it
This picturebox does NOT gets WM_KEYDOWN messages if the key is an arrow
key. Works OK if Num Lock is on so those keys are numerals.

1)A form with a textbox on it
This textbox gets those WM_KEYDOWN messages.

Maybe the fact that its a picturebox is not significant. Maybe something
else is causing the problem.

Any info or helpful suggestions would be appreciated
 
That is because of the way the controls manage input keys.
Before raising keydown event, it checks if the key is an input key.

So, override IsInputKey method as following :

protected override bool IsInputKey(Keys keyData) {
return true;
}

Hope it helps.

Ludovic SOEUR.
 
Ludovic SOEUR said:
That is because of the way the controls manage input keys.
Before raising keydown event, it checks if the key is an input key.

So, override IsInputKey method as following :

protected override bool IsInputKey(Keys keyData) {
return true;
}

Hope it helps.


Yes it did. Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top