autocomplete selection
-
Hi, Sorry this is gonna sound stupid I expect but here goes Using m_AutoCompleteStringCollection = new AutoCompleteStringCollection(); textBoxName.AutoCompleteMode = AutoCompleteMode.Suggest; textBoxName.AutoCompleteSource = AutoCompleteSource.CustomSource; textBoxName.AutoCompleteCustomSource = m_AutoCompleteStringCollection; How, without a mouse, do you select an item for an autocomplete textbox? I have tried key down on the keyboard but that just makes a selection of the first item. I want the user to be able to select any item or type their one choice. This is going to be used as a login where the name can be a known name or a visitor. Thanks, Iain
-
Hi, Sorry this is gonna sound stupid I expect but here goes Using m_AutoCompleteStringCollection = new AutoCompleteStringCollection(); textBoxName.AutoCompleteMode = AutoCompleteMode.Suggest; textBoxName.AutoCompleteSource = AutoCompleteSource.CustomSource; textBoxName.AutoCompleteCustomSource = m_AutoCompleteStringCollection; How, without a mouse, do you select an item for an autocomplete textbox? I have tried key down on the keyboard but that just makes a selection of the first item. I want the user to be able to select any item or type their one choice. This is going to be used as a login where the name can be a known name or a visitor. Thanks, Iain
-
Down arrow works fine for me. Set the focus to the item to be selected and press enter to select.
जय हिंद
Yes you are correct. It appears that calling _TextChanged everytime resets the focus E.G. private void textBoxFirstName_TextChanged(object sender, EventArgs e) { if (textBoxName.Text.Length > 4) { getAutoCompleteSuggestions(); } } I have changed it to if (textBoxName.Text.Length == 4) To solve this It does seem to crash a lot too in debug but I will save that for another day
-
Yes you are correct. It appears that calling _TextChanged everytime resets the focus E.G. private void textBoxFirstName_TextChanged(object sender, EventArgs e) { if (textBoxName.Text.Length > 4) { getAutoCompleteSuggestions(); } } I have changed it to if (textBoxName.Text.Length == 4) To solve this It does seem to crash a lot too in debug but I will save that for another day
-
Is there any specific need to display the autocomplete suggestions only after 4 characters?
जय हिंद
It was to keep the selection down to something reasonable. All works now thanks for your help.