VB.NET:如何美元的一个ComboBox p $ pvent用户输入美元、用户、NET、VB

2023-09-03 11:54:13 作者:星河鹭起

如何在一个ComboBox只有一个中所定义的列表中的项目做你prevent用户输入可以由用户来选择

How do you prevent user input in a ComboBox to that only one of the items in the defined list can be selected by the user?

推荐答案

设置组合框为DropDownList的DropDownStyle属性。这将允许唯一项目中所选择的列表并且将不允许任何自由形式的用户输入。

Set the "DropDownStyle" property of the combobox to DropDownList. This will allow only items in the list to be selected and will not allow any free-form user input.