private void TextBox1_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == 13) { button_Click(sender, e); } }