Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个组合框,我希望所选索引的字符串无法编辑 我该怎么做? 谢谢
如果你想阻止编辑组合框的文本框部分的能力,你应该设置
combobox1.DropDownStyle = ComboBoxStyle.DropDownList;
或使用表单设计器中的属性列表设置相同的属性
private void combobox1_KeyPress(object sender, KeyPressEventArgs e) { e.Handled = true; }