forcing combobox elements

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,
I have a C# project with a windows Form. In the form I have a ComboBox. I
would like to force the user to choose one of the entries in the combobox,
and not allow him/her to edit the content of the entry chosen.
Is this possible in some easy and elegant way?

thanks,
 
Hello,
I have a C# project with a windows Form. In the form I have a ComboBox.. I
would like to force the user to choose one of the entries in the combobox,
and not allow him/her to edit the content of the entry chosen.
Is this possible in some easy and elegant way?

thanks,


Sure is, just specify DropDownStyle = ComboBoxStyle.DropDownList
 
Thanks, that's great.
Is there a way to set a default value when the form opens?

thanks again,
 
Thanks, that's great.
Is there a way to set a default value when the form opens?

thanks again,

Set SelectedIndex on the ComboBox. You can do that in the Form.Load event or after InitializeComponent in the constructor. Specify -1 to clear the selection.
 
Great!
thanks!
--
dshemesh


Morten Wennevik said:
Set SelectedIndex on the ComboBox. You can do that in the Form.Load event or after InitializeComponent in the constructor. Specify -1 to clear the selection.
 
Back
Top