combobox

  • Thread starter Thread starter Jade
  • Start date Start date
J

Jade

Hi,

i wanted to know how i can make a combo readonly. at the
moment the user can edit the values in the combobox at
runtime
 
private void cboFacilities_KeyPress(object sender,
System.Windows.Forms.KeyPressEventArgs e)

{

e.Handled = true;

}
 
Jade said:
Hi,

i wanted to know how i can make a combo readonly. at the
moment the user can edit the values in the combobox at
runtime
IIRC, if you change the Type property to Drop List, that will disable
editing by the user. Hope this helps.
 
hi Peter,
how would i change this setting? i have looked in the
comboboxes property list but i could not see it there

thx
-----Original Message-----

Hi,

i wanted to know how i can make a combo readonly. at the
moment the user can edit the values in the combobox at
runtime
IIRC, if you change the Type property to Drop List, that will disable
editing by the user. Hope this helps.

--
Peter [MVP Academic]


.
 
jade said:
hi Peter,
how would i change this setting? i have looked in the
comboboxes property list but i could not see it there

thx

Are you using the Visual Studio .NET IDE? Type appears as a design time
property in the Properties Window.
 
jade said:
hi Peter,
how would i change this setting? i have looked in the
comboboxes property list but i could not see it there

thx

Check out
The DropDownStyle property

in the help.

Here is an excerpt:

The DropDownStyle property determines whether the user can enter a new value
in the text portion, and whether the list portion is always displayed.

Members
Member name Description
DropDown The text portion is editable. The user must click the arrow
button to display the list portion.
DropDownList
Supported by the .NET Compact Framework.
The user cannot directly edit the text portion. The user must click the
arrow button to display the list portion.
Simple The text portion is editable. The list portion is always
visible.
 
Back
Top