Recimo da imas 2 text box-a: txtUserName i txtPassword
dva dugmeta btnOK i btnCancel
1) Treba da ubacis dogadjaj za txtUserName (KeyPress):
Code:
private void txtUserName_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)
{
if ((e.KeyChar == 13) && (this.txtUserName.Text != "")) this.txtPassword.Focus();
}
2) Treba da ubacis dogadjaj za txtPassword (KeyPress):
Code:
private void txtPassword_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)
{
if ((e.KeyChar == 13) && (this.txtPassword.Text != "")) this.btnOK.Focus();
}