Override ProcessCmdKey C #

I have code that overrides the TextBox ProcessCmdKey method:

protected override bool ProcessCmdKey(ref Message msg, Keys keyData) { switch (keyData) { case: //something to do etc etc. } return true; } 

But when I use the code above, I cannot write to a TextBox. Is there a solution for this?

+4
source share
2 answers

After you have processed everything, pass it to the base control:

 protected override bool ProcessCmdKey(ref Message msg, Keys keyData) { switch (keyData) { case /* whatever */: // ... default: return base.ProcessCmdKey(ref msg, keyData); } return true; } 
+11
source

If you return true , it means that the input has been processed and it will not be passed to the next control, return false and it should work as you expect.

Link

0
source

Source: https://habr.com/ru/post/1403573/


All Articles