I've tried to override WndProc, but no message show up on paste event.
Then I tried to create custom filter and using method PreFilterMessage I was able to catch message with value 257 (KEYUP event), but that's not enough...
I've tried to override WndProc, but no message show up on paste event.
Then I tried to create custom filter and using method PreFilterMessage I was able to catch message with value 257 (KEYUP event), but that's not enough...
Use:
protected override void OnKeyDown(KeyEventArgs e)
{
if (e.KeyCode == Keys.V && e.Modifiers == Keys.Control)
{
MessageBox.Show("Hello world");
}
base.OnKeyDown(e);
}
Make sure your form KeyPreview = true.
You can do this by:
Personally I would go for using a menu option.
© 2022 - 2024 — McMap. All rights reserved.