By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
428,659 Members | 940 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 428,659 IT Pros & Developers. It's quick & easy.

Making a 'read-only' dropdown listbox

P: n/a
Hi,
I'm trying to figure out a sensible way of making a combobox (configured as
a dropdown list) behave in a read-only fashion.
Setting Enabled=False will grey the text and the background, but I want to
leave the component looking normal but not allow the user to change the
contents.
I've tried subclassing a combobox but can't see any overrides I can use to
produce this behavior.
A very last alternative will be to create a usercontrol with a label that
visually replaced the dropdown when the component is locked, but I would
much prefer to find a way of using the single native component.
Any ideas?

Cheers,
Jason
Nov 20 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Do you mean stopping the user from making another selection? As far as I
know, disabling it is about the only thing you can do.

"Jason Sobell" <iG******@hotmail.com> wrote in message
news:9q*****************************@40tude.net...
Hi,
I'm trying to figure out a sensible way of making a combobox (configured as a dropdown list) behave in a read-only fashion.
Setting Enabled=False will grey the text and the background, but I want to
leave the component looking normal but not allow the user to change the
contents.
I've tried subclassing a combobox but can't see any overrides I can use to
produce this behavior.
A very last alternative will be to create a usercontrol with a label that
visually replaced the dropdown when the component is locked, but I would
much prefer to find a way of using the single native component.
Any ideas?

Cheers,
Jason

Nov 20 '05 #2

P: n/a
Do you mean stopping the user from making another selection? As far as I
know, disabling it is about the only thing you can do.

"Jason Sobell" <iG******@hotmail.com> wrote in message
news:9q*****************************@40tude.net...
Hi,
I'm trying to figure out a sensible way of making a combobox (configured as a dropdown list) behave in a read-only fashion.
Setting Enabled=False will grey the text and the background, but I want to
leave the component looking normal but not allow the user to change the
contents.
I've tried subclassing a combobox but can't see any overrides I can use to
produce this behavior.
A very last alternative will be to create a usercontrol with a label that
visually replaced the dropdown when the component is locked, but I would
much prefer to find a way of using the single native component.
Any ideas?

Cheers,
Jason

Nov 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.