473,396 Members | 1,966 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,396 software developers and data experts.

C#:APPS - Grey out and disable some of the elements in combo box

6
Hi Guys and Girls,

I am building a windows application using VS2005, C#.net. Now, I have a combo box that contains a collection of elements.

Thus, I want to grey out some of the elements in the combo box. Alas, I cannot find any properties or forum that able to help me to grey out and disable some of the elements in combo box.

Does anyone have any idea on how to grey out and disable the combo box's elements. Your help is really appreciated.

Thank you and have a nice day.
Feb 20 '08 #1
2 4134
nateraaaa
663 Expert 512MB
Hi Guys and Girls,

I am building a windows application using VS2005, C#.net. Now, I have a combo box that contains a collection of elements.

Thus, I want to grey out some of the elements in the combo box. Alas, I cannot find any properties or forum that able to help me to grey out and disable some of the elements in combo box.

Does anyone have any idea on how to grey out and disable the combo box's elements. Your help is really appreciated.

Thank you and have a nice day.
Why grey them out? Just populate the combo box with the items that will be available to the user.

Nathan
Feb 20 '08 #2
Plater
7,872 Expert 4TB
Why grey them out? Just populate the combo box with the items that will be available to the user.

Nathan
Yeah, I would recomend that.
I'm not even sure it's POSSIBLE to "disable" some entries in a combo box. I've never seen it done.

ALTHOUGH, if you put an event handler on the selectedindex change event, you could maybe mimic the behaviour.
In it you would:
Check to see if the new index refers to a valid (read: not disabled) entry. If it's valid, update a state variable with the good index and exit the function.
If it's an INVALID index (disabled entry), change the index to the last "good" index saved in the state variable.
Feb 20 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: SAN CAZIANO | last post by:
how can clear an html SELECT and next insert in it all the elements of an array () I try this but seems doesn't works. function ComboAddArrayValueWithLabel(combo,ArrayLabel,ArrayValue) { ...
1
by: J Belly | last post by:
Hi, I have a table of questions (with radio buttons) that I want to appear greyed out so that users can feel they can skip it and go on to the next page. But if they should choose to answer the...
3
by: MervinJadhav | last post by:
How to disable combo items? Mervin Jadhav Software Developer Solutiioneyes Pvt Ltd (http://www.solutiioneyes.com) 203, Sai Chambers, 16 Mumbai-Pune Rd, Pune - 411 003 INDIA
5
by: acord | last post by:
Hi, Is there such thing that an item in the listbox is disabled and is appeared grey-out? How can I implement this in html/javascript? Thanks A
4
by: Patrick Flaherty | last post by:
Hi, Experienced programmer but new to PHP. Moreover I'm to use PHP with Xoops on top (this adds object orientation?). I don't seem to find a xoops Usenet group? Whatever the case (and...
5
by: Kevin Wilcox | last post by:
In Access 2003 I have a continuous form with a combo. I'm trying to find a way to change the displayed values of the combo depending on whatever value was selected in the combo in the previous...
11
Hiren Joshi
by: Hiren Joshi | last post by:
Hello All Experts, I am a Moderate VB Programmer. I am developing one Application at the moment with VB 6.0 and MS Access. Operating System is Win XP. Its a Multi User application. What I want...
2
by: prokopis | last post by:
am using c# for windows application and i need some help. i have a combo box that is connected with the database and retreive the data from a table in the database.this tha i need is if is possible...
0
by: dudeja.rajat | last post by:
On Sat, Aug 30, 2008 at 2:32 PM, Fredrik Lundh <fredrik@pythonware.comwrote: Fredrik, Thanks so much. That worked. Following this, I can now see that my combo2 has no previous elements and...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.