ComboBox问题[已解决] [英] Problem with ComboBox [Solved]

查看:61
本文介绍了ComboBox问题[已解决]的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,
我在应用程序中使用了ComboBox.
我想禁用该组合框中的文本输入,这意味着不应编辑组合框中显示的文本.
我尝试将控件设置为ReadOnly,但随后我看不到列表,该按钮也被锁定.

有人可以告诉我我需要做什么吗?
我知道这一定很简单,但是我不明白.

谢谢,
Nagendra.

Hi All,
I am using ComboBox in my application.
I want to disable the text entry in that combobox, means should not edit the text displayed in combobox.
I tried making control ReadOnly, but then i can''t see the list, the button is also getting locked.

Can anybody tell me what i need to do?
I know this must be simple one but i am not getting it.

Thanks,
Nagendra.

推荐答案

您可以使用DropDownStyle.在ComboBox.DropDownStyle
You can play around with DropDownStyle. In ComboBox.DropDownStyle


中,在设计器上,选择您的ComboBox,然后浏览其属性并从 DropDown DropDownList
On the designer select your ComboBox then navigate its properties and change DropDownStyle from DropDown to DropDownList


,您可以使用指示符变量来指示组合框已禁用,而只是放弃更改事件中的任何更改.

祝你好运!
You could use an indicator variable to indicate that the combobox is disabled and simply discard any changes in the change event.

Good luck!


这篇关于ComboBox问题[已解决]的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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