Ho un modulo in C# che utilizza uno ComboBox
. Come impedire a un utente di inserire manualmente il testo nello ComboBox
in C#?Come impedire l'inserimento manuale in un ComboBox in C#
this.comboBoxType.Font = new System.Drawing.Font("Arial", 15.75F);
this.comboBoxType.FormattingEnabled = true;
this.comboBoxType.Items.AddRange(new object[] {
"a",
"b",
"c"});
this.comboBoxType.Location = new System.Drawing.Point(742, 364);
this.comboBoxType.Name = "comboBoxType";
this.comboBoxType.Size = new System.Drawing.Size(89, 32);
this.comboBoxType.TabIndex = 57;
Desidero che A B C sia l'unica opzione.
È ancora possibile fare clic con il testo selezionato nella casella combinata e ha colpito Cut, voilà, testo scomparso – ajeh