| |

VerySource

 Forgot password?
 Register
Search
View: 810|Reply: 2

c# keyboard events!

[Copy link]

2

Threads

2

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 Invalid IP Address

Post time: 2020-12-14 14:30:01
| Show all posts |Read mode
The login form has user name, password box, OK button, how to use keyboard events (Enter key) to make the cursor jump automatically, thank you? ? ? ? ?
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-12-14 19:15:01
| Show all posts
private void txtBoxName_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (e.KeyChar == (char)Keys.Return)
            {
                txtBoxPwd.Focus();
            }

        }

        private void txtBoxPwd_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (e.KeyChar == (char)Keys.Return)
            {
                btnLogin.Focus();
            }
        }

I am also learning recently, look at this
Reply

Use magic Report

0

Threads

1

Posts

1.00

Credits

Newbie

Rank: 1

Credits
1.00

 China

Post time: 2021-1-30 13:04:57
| Show all posts
e.KeyChar == (char)Keys.Return
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list