Hi,
I ve a login form in c# windows application . I want that after typing username and password when user
presess enter key the button click e.i submit button should invoke...
How can i do that....
tnx....
blah blah blah is here! blah blah » Close
1 answers
On the events on properties window select the method key enter or enter then put your codes there to invoke the enter event
answered 2 years ago by:
0
tnx 4 d reply...i m little new 2 c#...
Can u tell me plz how can i invoke button Click event on enter key in a TextBox...
answered 2 years ago by:
0
Hello there..
what you can do is that in the keydown event of textbox check if the entered key is "Enter" key and if so invoke the button click event in code.
private void textBox1_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter)
{
button1_Click(sender, e);
}
}
private void button1_Click(object sender, EventArgs e)
{
MessageBox.Show("Hi");
}
check out..
Shiva
answered 2 years ago by:
0
tnx shiva....
answered 2 years ago by:
0
This post was imported from csharpfriends, if you have a similiar question please ask it again.
All previous members have been migrated, hope you enjoy the new platform!