Re: Can I implement an autofill feature with a textbox?

From: Warmrain (Warmrain_at_discussions.microsoft.com)
Date: 01/14/05


Date: Fri, 14 Jan 2005 11:49:03 -0800

As it turns out Greg Dunn's example using a combobox does NOT require you to
set the DroppedDown on entry and it DOES work with a Simple style combo. I
simply placed a single line high (textbox sized) combo on the form, set the
style to simple, filled the list with some test data (in the IDE) and then
ran the project.

I type some characters and hit the down arrow and get the closest match. If
the Sorted property is set to true then it work better when the first "hit"
isn't the correct one.

I'd like to see your example though...

Best, Steve

"Corbin" wrote:

> Greg,
>
> Thanks for the suggestion. I have tried it and again I am not getting
> the behavior that is desired. My problem with the combobox is that
> every other place where I use comboboxes, the DropDownStyle property
> is set to DropDownList, forcing the user to select an item rather than
> entering a value not on the list. To avoid confusion, I don't want to
> have some comboboxes that do enforce this and others that do not. So
> if I use a cbo, it has to at least look like a textbox. This can be
> achieved with a DropDownStyle set to Simple, but then even with your
> suggested code in the Enter event it does not attempt to auto-complete
> text as it is typed in or even when the cbo loses focus.
>
> Is it possible to implement some form of auto-completion with a cbo
> that is set to DropDownStyle=Simple? So far, I'm not having any luck.
>
> Thanks,
> Corbin
>
> "Greg Dunn" <newsgroups@gregdunn.com> wrote in message news:<O9Tvu5lnEHA.2612@TK2MSFTNGP15.phx.gbl>...
> > >> Am I even using the right control?
> >
> > A sorted ComboBox gets you pretty darn close to what you want with almost no
> > coding. If you set the DroppedDown property of the ComboBox to True in the
> > Enter event, then wherever your user lands in the ComboBox, the list is
> > dropped down automatically. Then typing any sequence of letters followed by
> > the DOWN ARROW selects the closest match in the list.
> >
> > Greg Dunn
> >
>



Relevant Pages

  • Re: DroppedDown
    ... I want to drop down a combobox when the mouse enters and collapse it ... in the droppeddown portion of the combobox droppeddown is closing. ... Plz Help me to solve this problem sir as it is really really high priority. ... It will not release capture until the window is ...
    (microsoft.public.dotnet.framework.windowsforms)
  • Combobox text not in list strange behaviour
    ... However if I do a droppedDown = true in the onEnter ... event handler and then tab to another combobox, the text value is reset to ... End Sub ...
    (microsoft.public.dotnet.framework)
  • Re: Open a combobox
    ... 'DroppedDown' /is/ a member of the Windows Forms combobox control! ...
    (microsoft.public.dotnet.languages.vb)
  • Re: ComboBox and automatic dropDown
    ... > if the user tabs to the comboBox ??? ... Add a handler to the control's 'Enter' event and set its 'DroppedDown' ...
    (microsoft.public.dotnet.languages.vb)
  • Re: ComboBox Array troubles
    ... Greg I put together the code you provided and it works. ... I have used a combobox in the protected form because of the 25 entry limit ... protect the document. ... Word MVP web sitehttp://word.mvps.org ...
    (microsoft.public.word.vba.general)