Reputation: 2137
In order to transfer text from one textbox to another, I have created a submit button. However it would be preferable to use the functionality of the 'enter' key.
I am not sure but i think the ascii code is 13.Anyway how do I go about this task at hand?
Upvotes: 8
Views: 16712
Reputation: 1065
You can subscribe to the KeyUp event of the text box.
using System.Windows.Forms;
private void txtInput_KeyUp(object sender, KeyEventArgs e)
{
if(e.KeyCode == Keys.Enter)
DoSomething();
}
Upvotes: 5