.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Imran Ghani
Post New Web Links

Keyboard Accelerators and the Alt Key

Posted By:      Posted Date: September 26, 2010    Points: 0   Category :WPF

I note that controls in WPF can have accelerators, assigned using the "_" character, as in,   "myButton.Content = "_DoSomething".  Typically, when the above accelerator is assigned, pressing the "Alt" key first displays the accelerator.  Then pressing "D" does the action, pressing the button, in this case. 

I want to programmatically fire the "Alt" key event, so that the user does not have to first press Alt.  I recognize that there is a display properties option for this, but each user will have their unique setting and I do not want to alter their display properties. 

I've tried code of this form:


 KeyEventArgs e1 = new KeyEventArgs(Keyboard.PrimaryDevice, Keyboard.PrimaryDevice.ActiveSource, 0, Key.LeftAlt);

e1.RoutedEvent = Keyboard.KeyDownEvent;


But it doesn't quite do the trick.   Can anyone h

View Complete Post

More Related Resource Links

PDA Keyboard v1.0 Light Edition - Full Screen Keyboard

The default keypad on Windows Mobile is not at all finger friendly, there is no way you can use it with your fingers. I have trouble using the stylus with it too. But there are many freeware option available to make the SIP ( Software Input Panel - check the Glossary ) finger friendly. Some of these are HTC Diamond keyboard, Blimkeys, PocketCM Keyboard and then now we have PDA Keyboard v1.0 Light Edition from pdamedia.biz. When you hit the blue button it goes into fullscreen mode , then you can use both your hands for typing.

Keyboard shortcuts stops working in WebMatrix


I'm often experiencing that keyboard shortcuts stops working in WebMatrix. This is very annoying as CTRL-S, CTRL-C, CTRL-V, etc. stops working, all of which are heavily used when programming. It's obviously hard to explain how to reproduce this, but I was wondering if someone knows a quick-fix?

Mobility: Add Keyboard Support to Compact Framework Apps by Trapping Windows Messages


The Compact Framework Control class doesn't provide direct access to Windows messages. However, with P/Invoke, a few lines of native code, and the Compact Framework MessageWindow class, it's still possible to access underlying Windows messages. This can be used to work around any .NET Framework features, including keyboard support, that are not included in the Compact Framework.

Alan Pulliam

MSDN Magazine April 2004

How to? Virtual Keyboard

Hi,I'm trying to create a website (asp.net in c#) to be used on a touchscreen monitor and need to do data input for the webpage by a virtual keyboard (on screen). I found one that allows me to do so (click here) but it has some restrictions.#1. I'm only able to assign one keyboard to one textbox - which means if i have ten textboxes I'll need to create ten keyboards for each textbox#2. I am unable to use it for dynamically created controls (e.g. gridview) as I have no idea what the created grid view control id's are. Is there a way for me to do data input using one keyboard for all my controls (could be another method different from the one I mentioned)? If not, can anyone tell me how I'll me able to get control id on control focus please?I appreciate your help.Thanks!

Symbol.Keyboard.KeyPad() object creation problem

on windows mobile 6.5 application running on Windows mobile 6 professional VGA emulator. I am trying to work on keyboard functionality like function key press events. I have coded the below line.   Symbol.Keyboard.KeyPad keypad = new Symbol.Keyboard.KeyPad();   keypad.KeyStateNotify +=new Symbol.Keyboard.KeyPad.KeyboardEventHandler(keypad_KeyStateNotify); keypad.AlphaNotify +=new Symbol.Keyboard.KeyPad.KeyboardEventHandler(keypad_AlphaNotify);   Its build successfully but raising exception at runtime. please help me out to run this code on emulator. because i don't have device.

Keyboard device information

Hello, I am developing an application and at some point I need to retrieve information on the keyboard that provides input. More specifically, I need to retrieve the keyboard's hardware ID (or even the product & vendor ID if possible). When a key is pressed I receive a KeyDown event but I can't seem to find the needed information within the provided KeyEventArgs structure. Any help would be appreciated, thank you very much. Panos

How can I disable the LWin and RWin keyboard keys?

I would like to modify my application to prevent the user from launching the start menu while my application is running.  Is there a logical, simple, sensible means of doing this from a Windows Form?  My application is built in Visual Studio 2005 using the C# language.  Thanks for any assistance you can offer on this matter.

Automatically select item with keyboard navigation in a combobox


Hi there,

in a WinForms ComboBox the selected item automatically changes, when I navigate through the combobox items with keyboard.

However, in the WPF ComboBox (IsEditable = false), the item in the list is highlighted but not automatically selected. Is there a way to change this behaviour?




Keyboard settings for Region and Language settings



Is there a way to change the keyboard settings for the selected region and culture settings through c# code?

Thanks in Advance!!!!

Best Regards,
Subalakshmi Vijayarajan.

can the tabcontainer tabs be made accessible - with the user tabbing along them with their keyboard?


We have some tabContainers on our site and we would like to make them accessible.

So that the user can access each tab with their keyboard.

i.e. navigate with the tab key on their keyboard instead of their mouse.

is this possible?

thanks in advance.

How to disable f12 key in keyboard in asp.net?? and How to edit and access registry value of operati


How to disable f12 key in keyboard in asp.net??help me ...
How to disable f12 key in keyboard in asp.net??
How to edit and access registry value of operating system using asp.net and how to disable usb port function using asp.net ??
help me ...

How to disable f12 key in keyboard in asp.net??help me ...

How to disable f12 key in keyboard in asp.net??

How to edit and access registry value of operating system using asp.net and how to disable usb port function using asp.net ??

help me ...

keyboard layout change dynamically


Hi everybody,

I am having two text boxes, txtEnglish and txtHindi on an asp.net web page. when txtEnglish is

getting the focus, the keyboard layout should be changed. There is an API function 'LoadKeyboardLayout' for this purpose. but this API is not working well!!!!. and also

i have to call this 'LoadKeyboardLayout' from the javascript.

Or any other method is there in Javascript to change the keyboard layout???

If any one can help me,

please make it fast, bcos it's urgent and i am hanging on this for three days.

Combination Keyboard Shortcut KeyBinding Question


Hi Everyone,

My question is whether it is possible to create a keybinding for Ctrl+A,N.  Meaning that the user will first press Ctrl+A and then press N.

I am aware that Ctrl+A can be catered for very easily.

Any response will be valued.

how to expand a collapsible fieldset when user hit tab button from keyboard?



By using this tutorial Stylish Collapsible Fieldset using CSS3 and JQuery, I have created asp.net web form with collapsible fieldsets. In this when page loads all the fieldsets are collapsed/closed but when user clicks on any fieldset it becomes expand/open.

Now I want to and another feature that when user finishes entery data in the controls of first fieldset and he/she wants to move to the next fieldset then he/she can open it by just hitting/pressing tab from the keyboard.

Here is my Jquery code-

$(document).ready(function() {
        $("legend").click(function() {
        $("fieldset legend").addClass("collapsed");
        $("fieldset legend").nextAll("ul").hide();

Can anyone let me know, what will be the modifications?



Keyboard malfunctioning with Visual Web Developer Express


Hello, several buttons my my wireless logitech keyboard stop working (the "back", "enter" buttons)---but only when I'm using Visual Web Develop Express. The problem does not happen with any other application. Any one heard of this? How can I resolve it? Thank you.

Is there any way to restyle windows 7 onscreen keyboard?


I want to use windows 7 onscreen keyboard with my fullscreen application.

So I need to change button styles (colors, sizes, margins, maybe shape) to fit my application style.

Is it possible? or the only way to achieve this is ti implement my own onscreen keyboard?

P.S. I'm using C# as programming language, so it would be great to see examples in it (if any)

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend