tony tony -4 years ago 133
C# Question

How to disable navigation from keyboard?

How can I disable navigation from keyboard? I want the user to be able to navigate only with mouse. For instance, the way my project is right now, the user can go from one field to another by pressing shift+tab. I want to prevent this.

Answer Source

Set the TabStop property to false on your controls.

But note that this is probably a bad idea in most scenarios - it will very likely hurt the usability of your application. For example, I highly prefer keyboard based navigation - but even besides my preferences, if my mouse batteries die I may need it to do something while my mouse isn't functioning. The TabStop property should really be used more for controls that just aren't meant to take user input (or at least aren't meant to receive keyboard focus) rather than intentionally disabling keyboard navigation.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download