I've tried this with a DropDownStyle set to DropDown and DropDownList.
DropDown works well in that I'm able to use the SelectionStart and
SelectionLength properties to show the user which characters have been
acknowledged. Unfortunately, there is a visible jitter to the search
process. It appears that the component is implementing its default
behavior, which is to find the first item that begins with the character
just entered. It also appears as thought the highlighting of the selected
text is being removed and replaced with each key.
Also, if the user types too fast, characters are skipped in the search
process. I've tried implementing the solution to this expressed on the site
that you referenced in one of your earlier posts
(
http://www.codeproject.com/vb/net/au...e_combobox.asp)
but it did not solve the problem.
All of the following processing takes place in KeyUp. I've omitted the code
that handles the backspace and excape keys.
private void cbTaskLookUp_KeyUp(object sender,
System.Windows.Forms.KeyEventArgs e)
{
string cbText = cbTaskLookUp.Text.ToUpper();
string cbItemText;
int cbTLUL = cbTaskLookUpInput.Length;
ComboBox cb = (ComboBox)sender;
try
{
if ((e.KeyValue < 65 || e.KeyValue > 90) & e.KeyValue != 32)//other keys
are handled elsewhere
return;
cbTaskLookUpInput += (char)e.KeyValue;
lblSoFar.Text = cbTaskLookUpInput;//for debugging
cbTLUL = cbTaskLookUpInput.Length;
LocateCBOItem(cb, cbTaskLookUpInput, cbTLUL);
}
finally
{
e.Handled = true;
}
}
private void LocateCBOItem(ComboBox cb, string InputString, int isLength)
{
int iFindString;
iFindString = cb.FindString(InputString);
cb.SelectedIndex = iFindString;
cb.SelectionStart = 0;
cb.SelectionLength = isLength;
lblSoFar.Text += " " + iFindString.ToString();//for debugging
}
Thanks for your help.
"Bruce Wood" <br*******@canada.com> wrote in message
news:11**********************@g44g2000cwa.googlegr oups.com...
I can't seem to visualize your problem... can you explain what's
happening in more detail?