Reputation: 1
This is my code:
private void gv_old_KeyPress(object sender, KeyPressEventArgs e)
{
if (e.KeyChar == 27)
{
gv_old.Visible = false;
// And want focus on that TextBox
}
}
What I want is to focus on the previous TextBox when the focus was on the DataGridView.
Upvotes: 0
Views: 99
Reputation: 2998
Let just say you have a textbox below :
TextBox textbox1;
You can set focus on the textbox like this,
textbox1.focus();
Upvotes: 1