如何禁用组合框元素C#的编辑? [英] How to disable editing of elements in combobox for c#?

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

问题描述

我有一个组合框(用C#的WinForms)一些元素。我希望他们的内容是静态的,使得用户不能改变时,应用程序被运行内的值。我也不希望用户添加新值将ComboBox

I have some elements in a ComboBox (WinForms with C#). I want their content to be static so that a user cannot change the values inside when the application is ran. I also do not want the user adding new values to the ComboBox

推荐答案

使用的ComboStyle属性:

Use the ComboStyle property:

comboBox.DropDownStyle = ComboBoxStyle.DropDownList;

这篇关于如何禁用组合框元素C#的编辑?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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