I have two textboxes in my windows form named txtUserName
and txtPassword
, now I'm populating the txtUserName
using the code
AutoCompleteStringCollection myCollection = new AutoCompleteStringCollection();
_userEMailList = UserCredentials.GetUserEmails();
foreach (var item in _userEMailList)
{
myCollection.Add(item);
}
txtUserName.AutoCompleteCustomSource = myCollection;
where UserCredentials.GetUserEmails()
method returns a List<string>
.
Now the user will get suggestions and thus can select from one of the options.
So my problem is that when the user selects from one of the suggestion, the value of txtPassword
should auto-fill. I have a method which takes EMail-ID as a parameter and returns the password. In web application, we can use onblur
but as my code is part of a windows application, so JavaScript
usage is not possible.