开发者

How to make combo box accept value from keyboard

I have a combo box wherein I am feeding in items in drop down box. Apart from this I also want my combo box to accept the values I feed from my keyboard. When I write anything in the combo box then I get this exception message:

InvalidArgument=Value of '-1' is not valid for 'index'.

Parameter name: inde开发者_开发知识库x

It should display a list of items in list box from the index I gave in combo box 1 to combo box 2.

How to do this?


The combobox has a DropDownStyle property. This property change the behaviour of the combbox in runtime. Check if you can set a value in this property that matches the behaviour that you want.

Other option could be using an AutoComplete TextBox/Combobox. Here is a link with info about how to do it.LINK. It is preyty easy.


For this to happen, you need to capture the TextChanged event of the combo box and write the appropriate event handling code to populate the second list box.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜