I am working in windows form application using c#. I have two fields in a form "Username" and "password" and two buttons "Login" and "Cancel". On form loading cursor is placed in Username textbox which is ok.
But when I press TAB from my keyboard instead of going to Password textbox its going to Login button. How can I set this?
Also the shortcut CTRL+A to select all text is not working in text fields. Any help?
Every control on WinForms has a TabIndex. This you can find in the properties of the control. You need to adjust this value to 2 in the Password textbox if you want to have the focus switch there after tab
Select your control in the designer, go into the properties:

and set the TabIndex property:

The shortcut Cntr + A will only work if you have the focus on the TextBox! Also make sure that the ShortCutsEnabled property is set to true:

For reference here is the original answer for the shortcut problem. It says however that:
The TextBox control does not support the CTRL+A shortcut key when the Multiline property value is true.
Change the tabindex property of your password textbox 1 higher to the tabindex of your username textbox. (i.e. Username tabindex = 1, password tebaindex = 2)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With