hey hey...

just want to know, if theres some kind of way to prohibit the user from entering data into a combobox...

i dont want to use a list box... to must space taken, and no point in disabling it... as then i cant select an item...

please help
thanx in advanced

A ComboBox comes in three flavours.
You just got to set the DropDownStyle property.
DropDownStyle = ComboBoxStyle.Simple; This acts as a simple list(not what you want)
DropDownStyle = ComboBoxStyle.DropDown; This is what you want, you can't edit.
DropDownStyle = ComboBoxStyle.DropDownList; A list, and you can edit text.
Hope this helps.

commented: solved~! +13

weird thing is, its already set on that... yet i can still edit... :/

A ComboBox comes in three flavours.
You just got to set the DropDownStyle property.
DropDownStyle = ComboBoxStyle.Simple; This acts as a simple list(not what you want)
DropDownStyle = ComboBoxStyle.DropDown; This is what you want, you can't edit.
DropDownStyle = ComboBoxStyle.DropDownList; A list, and you can edit text.
Hope this helps.

as i played with this property... i noticed something... either u made a small mistake ( i dont mind, as it got me closer to solving the prob) or my VS is screwed... anyway...

DropDownStyle = ComboBoxStyle.Simple; This acts as a simple list(not what you want)
DropDownStyle = ComboBoxStyle.DropDown; This is what i dont want, you can edit it.
DropDownStyle = ComboBoxStyle.DropDownList; A list, and you cant edit text, which i want

thanx much appreciated...

DropDownStyle = ComboBoxStyle.DropDownList;

using the above 1, sorted my problem.
thanx

lols

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.