Thanks for the quick response, Arik. That's a great idea (using the ComboBox). I think it'll be much better than the TextBox.
Now, following your suggestion. I have three questions. Keep in mind, I did check out your Ribbon ComboBox post (which was very helpful btw), but I'm still having some trouble.
1) It seems there is no KeyPress/KeyDown event. Is there any possible way to achieve this? The way my old TextBox worked that I'm replacing is I gave the user the option of searching as they type, or after Enter is pressed. So, I need to
know whenever a key is typed and also test to see if it was the Enter key. (see next question).
2) If it's possible to achieve what I'm hoping to do in question 1, how can I test each character to see if the Enter key was pressed. What I'm familiar with when it comes to the KeyPress or KeyDown event for the Winforms ComboBox is as follows.
Can I do something similar with the Ribbon ComboBox?
If e.KeyChar = Microsoft.VisualBasic.ChrW(Keys.Return) Then '// e as System.Windows.Forms.KeyPressEventArgs
If e.KeyCode = Keys.Enter Then '// e As System.Windows.Forms.KeyEventArgs
' do something
3) How can I check if the ComboBox already contains a value?
When Enter is pressed in the ComboBox, I'm adding the ComboBox StringValue to the drop down as you suggested to record previous searches, but I can't figure out how to check if the StringValue already exists. I don't want duplicates. What I've been
use to doing with the standard WinForms ComboBox is as follows. Is there anything equivalent?
If ComboBox1.Items.IndexOf("Some string value.") = -1 Then
If Not ComboBox1.Items.Contains("Some string value.") Then
' add item to ComboBox
Thanks for your help and patience. You're probably light-years ahead of me as a programmer. I hope I'm not pushing it with 3 questions. :)