473,511 Members | 16,846 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Checked Listbox Text Color

I am looping throught the items in a checked list box. If it helps, all
of the items are checked. If I string of text matches a certain
criteria I would like to change it's text color to red. I know this is
incorrect, but something like so:

If clbFinalList.Items(intLoopCount) = strBadA(x) Then
clbFinalList.Items(x).forecolor = Color.Red
End If

What is the proper syntax to accomplish this?

Thank you,
John

May 26 '06 #1
1 7042
Assuming you're talking about the System.Windows.Forms.CheckedListBox class
then there is no built in support for that. You would have to ownerdraw it.
Consider using a ListView instead.

/claes

"jcrouse" <jc******@hotmail.com> wrote in message
news:11**********************@i39g2000cwa.googlegr oups.com...
I am looping throught the items in a checked list box. If it helps, all
of the items are checked. If I string of text matches a certain
criteria I would like to change it's text color to red. I know this is
incorrect, but something like so:

If clbFinalList.Items(intLoopCount) = strBadA(x) Then
clbFinalList.Items(x).forecolor = Color.Red
End If

What is the proper syntax to accomplish this?

Thank you,
John

May 26 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
6975
by: Megan | last post by:
Hi- I'm creating a database of music bands with their cds and songs. I'm trying to program an SQL statement so that I can enter a string of text in a textbox, press the 'Enter' key, and have...
5
5731
by: Hrvoje Voda | last post by:
I got the index of all checked values, but I don't know how to read data of that value? For example.. in list box I have Names of users. First is John(index 1), Second is Jack(index 2) and so...
3
35902
by: Hrvoje Voda | last post by:
After I fill checked listbox with data, I would like to checked all items in list ? Hrcko
1
1668
by: Hrvoje Voda | last post by:
I fill a checked listBox with data from dataset. I would like, when a user checked one item , to save it in dataset. The problem is that I don't know how to get its ID number, because I have...
3
5968
by: Hrvoje Voda | last post by:
I fill a checked listbox with name from dataset. I would like to go through that names and if I find the same name in list, then that line should be checked. How? Hrcko
21
2232
by: Bilal Abbasi | last post by:
I realize that you can add items to a list box as objects so you can have access to more than just one property like the itemindex in vb6. Question I have is how do I cause the listbox to show a...
3
2891
by: Dean Slindee | last post by:
In a checked listbox, I am allowing drag/drop of the items within (resequencing). Problem is, when dropping a checked item, the checked state always reverts to unchecked (unwanted). Anyone know...
1
7002
by: Dennis | last post by:
I have a checked list box and am trying to use the SetItemCheck method as follows: mylistbox.SetItemChecked(indextoset, True) It seems to have no effect and the display does not show the box...
4
2657
by: spowel4 | last post by:
My form has a listview populated with the 50 states. When the user checks the checkbox within the listview for a particular state, I need to retrieve which state was checked (i.e. if AZ is checked...
0
7242
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
7138
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...
1
7081
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
7510
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
5668
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,...
0
4737
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
3225
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1576
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 ...
1
781
muto222
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.