To find out if user has ended entering password or not,
You can use different event handlers for Text Box control.
First is when user presses and releases a key,
when we check if user have pressed key 'Enter' as end of entered password.
Second is if user use mouse to change focus of current control,
select something else on form and ends input in current active Text Box.
In every event handler we have CheckPassword() call for sub
that process entered password (text) in Text Box.
Look at the code :
void TextBox1KeyPress(object sender, KeyPressEventArgs e)
{
if(e.KeyChar == (char) Keys.Enter)
{
CheckPassword();
}
}
void TextBox1Leave(object sender, EventArgs e)
{
CheckPassword();
}
There are many more ways to handle this type of problem.
Try different event handlers :
Text Box Events[
^]
All the best,
Perić Željko