473,471 Members | 1,995 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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

6 New Member
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 4137
nateraaaa
663 Recognized Expert Contributor
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 Recognized Expert Expert
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
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.