469,628 Members | 1,031 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,628 developers. It's quick & easy.

Making a 'read-only' dropdown listbox

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
2 3160
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
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.

Similar topics

26 posts views Thread by Alexander Farber | last post: by
351 posts views Thread by CBFalconer | last post: by
4 posts views Thread by ShieldsJared | last post: by
1 post views Thread by getelectronic | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.