473,387 Members | 1,440 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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 3427
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: McGrull | last post by:
Sorry for my question, but I'm really a newbie on ASP. I need to make a simple page (for IIS 5.0 and up, but even for 2000 Professional IIS) that read and display the files contained in a...
26
by: Alexander Farber | last post by:
Hi, I have a UNIX-server written in C, which exchanges messages with Java clients. In the message the 1 byte is its length, the 2nd a player number and the 3rd byte is an event id: /* 0....
6
by: mt404 | last post by:
Hi, I was wondering if someone might be able to provide some guidance on how I could make an http request from a C# library. Basically I have a library which accepts a couple of arguments that...
0
by: Mike Cox | last post by:
Hi. As most of you know, comp.databases.postgresql.general is a wonderful resource. What you may not know is that it has not gone through a process that would enable it to be listed on hundreds...
351
by: CBFalconer | last post by:
We often find hidden, and totally unnecessary, assumptions being made in code. The following leans heavily on one particular example, which happens to be in C. However similar things can (and...
4
by: ShieldsJared | last post by:
Im looking for help making a good GUI out of pure images. I would like to embed the common controls and such, but I want to make a nice looking GUI, similar to that of, say Windows Media Player. ...
10
by: JurgenvonOerthel | last post by:
Consider the classes Base, Derived1 and Derived2. Both Derived1 and Derived2 derive publicly from Base. Given a 'const Base &input' I want to initialize a 'const Derived1 &output'. If the...
1
by: getelectronic | last post by:
Hi all I have a sample code to implement opc client in Python. i use a file .py making by makepy with pythonwin for Com Interface. i can get all server in machine, connect to server opc,...
14
by: mesut | last post by:
hi colleagues, I don't know if this is the right group for but it's in C# so I try. I have a #3 procedural function called GetInfo.. and those are 3 overloaded methods. I would like to use the...
11
by: Rafe | last post by:
Hi, I'm working within an application (making a lot of wrappers), but the application is not case sensitive. For example, Typing obj.name, obj.Name, or even object.naMe is all fine (as far as...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.