473,403 Members | 2,323 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,403 software developers and data experts.

ListViewItem color

I want to change the color of the second column of the listviewitem to, say
red.
How do I do that?

I tried
listviewitem.subitems[1].ForeColor = Color.Red
but did not work.
Jul 14 '06 #1
2 6600
Use must set ListViewItem.UseItemStyleForSubItems to false as well. i.e.

listviewitem.subitems[1].UseItemStyleForSubItems = false;
listviewitem.subitems[1].ForeColor = Color.Red

HTH :)

Maqsood Ahmed - MCAD.net
Kolachi Advanced Technologies
http://www.kolachi.net

*** Sent via Developersdex http://www.developersdex.com ***
Jul 14 '06 #2
Thanks.
It's
listviewitem.UseItemStyleForSubItems = false;

"Maqsood Ahmed" <ma***********@gmail.comwrote in message
news:%2****************@TK2MSFTNGP05.phx.gbl...
Use must set ListViewItem.UseItemStyleForSubItems to false as well. i.e.

listviewitem.subitems[1].UseItemStyleForSubItems = false;
listviewitem.subitems[1].ForeColor = Color.Red

HTH :)

Maqsood Ahmed - MCAD.net
Kolachi Advanced Technologies
http://www.kolachi.net

*** Sent via Developersdex http://www.developersdex.com ***

Jul 14 '06 #3

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

Similar topics

2
by: Max Adams | last post by:
Question about using delegates with a string paramater to return a ListViewItem object... All, I have a thread and I want this thread to post messages to the main GUI thread using a delegate....
2
by: Chuck | last post by:
The ListViewItem class contains a readonly property called ListView which returns the item's containing ListView object. I have not been able to figure out how this value is set. The...
6
by: grs | last post by:
The following is a code example from the Microsoft MSDN. My question is on the following three lines of code: ListViewItem item1 = new ListViewItem("item1",0); ListViewItem item2 = new...
2
by: naikrovek | last post by:
Hello all. I have a ListView on a form, that has columns added at design-time but will be populated run-time. So, I know what the columns will be, and I know that I will have an arbitrary...
1
by: LagartijaNick | last post by:
Question: I have a ListView in which I'm selecting a ListViewItem based on the value of a textbox. On my XP machine (with default color scheme) the ..Selected row is a noticable grey (back color...
2
by: Kela | last post by:
An interesting problem: I have a ListView with LabelEdit set to TRUE. When I change the label, I want to make some decisions as to whether the ListViewItem (that's just been edited) should stay in...
0
by: garyusenet | last post by:
I am trying to create a form that will display a list of open internet explorer windows and allow the user to choose one of them. So far I have created an arraylist which contains all of the open...
13
by: deciacco | last post by:
How can I have access to the items collection of a listview control on my form from a background thread? I know I need delegates to update the listview control and I have those calls in the...
10
by: Gav | last post by:
I am trying to have a ListView to dispay a list of names and want to have an id stored within the list but not visable. I have tried to go about doing this by using the ListViewItem and setting...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
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
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,...
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,...
0
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...

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.