Exemplo n.º 1
0
 private void LoginForm_Load(object sender, EventArgs e)
 {
     LoginTextBox.Invoke(new MethodInvoker(() =>
     {
         LoginTextBox.AutoCompleteMode   = AutoCompleteMode.Append;
         LoginTextBox.AutoCompleteSource = AutoCompleteSource.CustomSource;
         var loginAutoCompleteSource     = new AutoCompleteStringCollection();
         loginAutoCompleteSource.AddRange(context.Users.Select(user => user.Login).ToArray());
         LoginTextBox.AutoCompleteCustomSource = loginAutoCompleteSource;
     }));
 }