如何禁止向comboBox控件输入数据?(在线等,立即结帖!)

lhb1980 2004-11-07 02:51:26
如何禁止向comboBox控件输入数据?(
...全文
224 12 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
12 条回复
切换为时间正序
请发表友善的回复…
发表回复
nedvedlh 2004-11-08
  • 打赏
  • 举报
回复
DropDownStyle 属性设置为 DropDownList 就可以了.
烤火的鱼 2004-11-08
  • 打赏
  • 举报
回复
只让用户选择,用comboBox的DropDownStyle设置为DropDownList,不让用户输入任何东西,设置enable=false,不过既然不允许输入任何东西,那货币用combbox呢,不如直接用label?
sgc8228 2004-11-07
  • 打赏
  • 举报
回复
兄弟,你好像说过"立即揭帖"???
sgc8228 2004-11-07
  • 打赏
  • 举报
回复
DropDownStyle 属性设置为 DropDownList
yinshuhai 2004-11-07
  • 打赏
  • 举报
回复
ReadOnly=true
BasaraTracy 2004-11-07
  • 打赏
  • 举报
回复
ReadOnly=true or Enable=false
zhongwanli 2004-11-07
  • 打赏
  • 举报
回复
同 paul8765(且行且珍惜)

paul8765 2004-11-07
  • 打赏
  • 举报
回复
刚才去看了一下,发现没有readonly这个属性
方法一;
把 DropDownStyle 属性设置为 DropDownList
方法二:
this.comboBox1.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.comboBox1_KeyPress);
private void comboBox1_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)
{
e.Handled = true;
}
vitamin_ok 2004-11-07
  • 打赏
  • 举报
回复
ReadOnly=true吧!

exboy 2004-11-07
  • 打赏
  • 举报
回复
把 DropDownStyle 属性设置为 DropDownList 就可以了.
linguicheng 2004-11-07
  • 打赏
  • 举报
回复
把comboBox的DropDownStyle设置为DropDownList
paul8765 2004-11-07
  • 打赏
  • 举报
回复
readonly = true;

111,094

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • AIGC Browser
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧