Locking a Combo-Box

  • Thread starter Thread starter Ryan
  • Start date Start date
R

Ryan

I need to lock a combo-box on my form. I want to allow the user to use the
drop down list but I don't want them to be able to type their own text in
the combo-box. I've tried the "locked" and "enabled" properties and neither
of these seem to do the trick. "locked" doesn't do much and if I set
"enabled" to false then I can't even use the drop-down.

Thanks,
Ryan
 
Ryan said:
I need to lock a combo-box on my form. I want to allow the user to use the
drop down list but I don't want them to be able to type their own text in
the combo-box. I've tried the "locked" and "enabled" properties and
neither of these seem to do the trick. "locked" doesn't do much and if I
set "enabled" to false then I can't even use the drop-down.

Set the 'DropDownStyle' property to 'DropDownList'.
 
Hi Ryan,

Thanks for your post!

Do you mean that you still enable the user the use DropDownList of Combobox
to change the selection while disabling the textbox typing in the Combobox?
This is one type of Combobox style which is named with "DropDownList". This
style disables the editing function in ComboBox.

Normally, the default combobox style is "DropDown" which enabling the
editing in ComboBox. You can set "DropDownStyle" property to "DropDownList"
to switch the style.

I think there maybe some typo in GhostInAK's reply. There is no "DropStyle"
property. "Herfried K. Wagner [MVP]"'s reply is correct.

Thanks.

Best regards,
Jeffrey Tan
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 
Back
Top