tags:

views:

244

answers:

1

I'm trying to figure out a way to prevent F10 from activating the window menu (same function as pressing 'alt') and fire keydown/previewkeydown instead. I know there are ways to do it using window.forms, but I'm using WPF on VB.net and I can't seem to find a method that would apply.

+1  A: 

Hi there,

You should use e.SuppressKeyPress = True in the Event Handler to achieve this.

Cheers,

Kyle


EDIT: My mistake, sorry.

Well then what you could do is do your catch code for your F keys before a e.Handled = true, which should clear the WM_Chars queue, meaning that the main control would not get the event. Also maybe look into WPF Commands to work into this way of working. I don't know of a very "clean" solution to this problem. Sorry.

Kyle Rozendo
This is a WPF project, not a Winforms Project.So what i'm essentially asking is, whats the equivalent of System.Windows.Forms.KeyEventArgs.SuppressKeyPress inSystem.Windows.Input.KeyEventArgs
Thanks =D This actually works for what i'm trying to do.Had to catch the key using e.SystemKey though, but i guess thats clean enough
Great stuff, glad it helped :)
Kyle Rozendo