I'm working with C# in Visual Studio 2005. I have a combobox with
AutoCompleteSource = ListItems and DropDownStyle = DropDown. I want users to
be able to type in the combobox and the control to autocomplete (Append
AutoCompleteMode), but have their options limited to the control's ListItems.
Right now the autocomplete works fine, but they can type anything that isn't
in the list. Is there an easy way to set the control to do this or am I going
to have to write code to verify what was typed during TextUpdate or another
event?

Re: Combobox autocomplete by Jim

Jim
Wed Aug 16 13:52:05 CDT 2006

> I'm working with C# in Visual Studio 2005. I have a combobox with
> AutoCompleteSource = ListItems and DropDownStyle = DropDown. I want
> users to be able to type in the combobox and the control to
> autocomplete (Append AutoCompleteMode), but have their options limited
> to the control's ListItems. Right now the autocomplete works fine, but
> they can type anything that isn't in the list. Is there an easy way to
> set the control to do this or am I going to have to write code to
> verify what was typed during TextUpdate or another event?

Change your DropDownStyle to DropDownList.
Jim Wooley
http://devauthority.com/blogs/jwooley/default.asp



Re: Combobox autocomplete by DavidTilman

DavidTilman
Wed Aug 16 15:32:02 CDT 2006

Thanks for the reply. I had experimented with that, but didn't like how the
control would respond if the user waited a second to type the second or third
character (the control would treat it like the first character again if the
pause was too long). I might end up just going with the DropDownList with
AutoCompleteMode = Suggest and see how the users like it.

"Jim Wooley" wrote:

> > I'm working with C# in Visual Studio 2005. I have a combobox with
> > AutoCompleteSource = ListItems and DropDownStyle = DropDown. I want
> > users to be able to type in the combobox and the control to
> > autocomplete (Append AutoCompleteMode), but have their options limited
> > to the control's ListItems. Right now the autocomplete works fine, but
> > they can type anything that isn't in the list. Is there an easy way to
> > set the control to do this or am I going to have to write code to
> > verify what was typed during TextUpdate or another event?
>
> Change your DropDownStyle to DropDownList.
> Jim Wooley
> http://devauthority.com/blogs/jwooley/default.aspx
>
>
>