I have a WPF user control where I have multiple text boxes and and combo boxes. For easy use I want to provide shortcut keys to focus some main control.
Suppose if I press ALT + M it will focus on a text box named txtPatient.
If I press ALT + B it will focus on a text box named txtRef.
I am using MVVM as the design pattern.
How can I do this?
Sounds to me like basic accessibility (mnemonics), which is easy to obtain by adding labels to your controls like:
Notice the “_N” – that means when the user presses ALT + N,
textBoxNamewill get focus.