C#用户控件:有关组合框的问题 [英] c# user control: question about combo box

查看:118
本文介绍了C#用户控件:有关组合框的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,

我有一个c#,并且有一个组合框.
我在组合框项目列表中输入了我希望用户选择的值.

用户仍然可以选择将光标放在组合框上,然后键入所需的任何内容.
如何禁用此选项,并且不允许用户在组合框中键入任何内容?
我希望用户只能从我创建的项目列表中选择值.

谢谢

Hello,

I have a c# and I have a combo box.
I entered the values I want the user to choose from to the combo box items list.

The user still has an option to put the cursor on the combo box and type whatever he wants.
How can I disable this option, and don''t allow the user to type anything in the combo box?
I want the user to be able only to choose values from the items list I created.

Thanks

推荐答案

将属性DropDownStyle更改为DropDownList,这样用户就无法在组合"框中编辑项目.
Change the property DropDownStyle as DropDownList then user can not edit items from Combo box.


仔细查看属性组合框.其中之一可以满足您的需求.
由于您的个人资料没有提供任何信息,所以我不知道更详细的信息是否有用.

希望这会有所帮助,
巴勃罗.
Look carefully at the properties of the combo box. One of them does what you want.
Since your profile does not provide any information , I can''t know whether more detailed information would be relevant.

Hope this helps,
Pablo.


这篇关于C#用户控件:有关组合框的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆