如何在C#中的comboBox上具有只读和可编辑的项目? [英] How to have readonly and editable items on a comboBox in C#?

查看:237
本文介绍了如何在C#中的comboBox上具有只读和可编辑的项目?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嘿..
我正在尝试在ComboBox中添加项目,其中2个为ReadOnly,1个为可编辑项目..我面临的问题是,我无法提出一种解决方案来编辑​​所选的可编辑项目..
我创建了一个ComboBox并添加了3个项目,并将dropdownStyle设置为DropDownList ..
有谁能够帮助我???
谢谢

Hey..
I am trying to add items in a ComboBox out of which 2 are ReadOnly and 1 is an editable item.. The problem I am facing,is i cant come up with a solution to edit the selected editable item..
I have create a ComboBox and added 3 items and set the dropdownStyle to DropDownList..
Can anybody help me???
Thanks

推荐答案

您可以处理下拉菜单中的按键事件.
根据所选内容,您可以取消或允许编辑.
You can handle the key down event on the dropdown.
Based on what has been selected, you can either cancel or allow the edit.


嘿Abhinav ..
感谢您的即时回复.
我需要更清楚一点.
我必须处理按键按下事件或选择更改事件吗?
谢谢
hey Abhinav..
thanks for your immediate response..
i need to get this more clear..
do i have to handle the key down event or Selection Changed event??
Thanks


这篇关于如何在C#中的comboBox上具有只读和可编辑的项目?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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