KeyListener with Combo

Frank Benoit keinfarbton at
Thu Sep 11 00:55:32 PDT 2008

Sam Hu schrieb:
> Hi ,
> I want to practice with KeyListener using Combo which permit the user
> to enter text in the text portion of the Combo. As the user types,
> the list portion of the Combo is searched for an item that matches
> the text that has been entered. If an item is found, it is
> automatically selected.Attached the source code.But it does not work.
>  I don't know what's wrong in the keyPressed() and keyReleased()
> method.Please help. Thanks, Sam

Can you explain more detailed what is not working?
Does it crash? In which line? You can use print statements to find the line.
Or does it not select the item? If so, does it execute the path you
expect? Also verify this with print statements.

For the functionality you want to implement, I see a problem with the
KeyListener. What if text is changed by drag and drop or the mouse
context menu "paste"?
I think the VerifyListener would be good choice.

More information about the Digitalmars-d-dwt mailing list