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

text of different colors in listview

When I add to a listview, can the text I have be of different colors?

For example, I want to add these two lines to my list view:

"This is my program"
"This is my other program"

Can I add it with "This is" written in red text while "program" is written
in yellow text? And then do the same thing with the second line?

Thanks.
Nov 15 '05 #1
1 1941
You can not do it out of the box. However, you can override the OnPaint
method, or attach to the Paint event on the TreeView and custom paint the
item yourself, applying whatever colors you wish.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"news.microsoft.com" <vm> wrote in message
news:eG**************@TK2MSFTNGP12.phx.gbl...
When I add to a listview, can the text I have be of different colors?

For example, I want to add these two lines to my list view:

"This is my program"
"This is my other program"

Can I add it with "This is" written in red text while "program" is written
in yellow text? And then do the same thing with the second line?

Thanks.

Nov 15 '05 #2

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

Similar topics

2
by: RickDee | last post by:
Does anybody know how to display different color text inside ListBox ? I was testing it with CreateGraphics and DrawString methods, but it does not work out. Thanks Regards
4
by: VM | last post by:
Can I add text of different colors to a listview? Let's say I want to add, on one line, the text "This is my message" on my listview. Would it be possible to add this sentence to the listview...
0
by: Ken Lameki | last post by:
Hi guys, Needed to know how to display items on a listview and the items on the same listview appear in different colors, say e.g items that need immediate attention are flagged in red for...
3
by: bthetford | last post by:
I have a ListView with 4 columns that shows in details mode. How do I change the text of one of the columns of a specific item if I know the index I want to change at? mylistview.Items.Tag...
6
by: rahulnag22 | last post by:
Hi, Is it possible to have different items in a listbox in different colors? Or is it just one color for all items in a listbox? Thanks Rahul
4
iam_clint
by: iam_clint | last post by:
Heres some sample code I wrote up for you guys to use on making text effects <script> //TEXT EFFECTS CODE WRITTEN BY iam_clint! window.onload = doEffects; var speed = 15; //lower the number...
1
by: =?Utf-8?B?LnBhdWwu?= | last post by:
how do i change the color of the text in the fixedrow (column headers) of a listview? thanks
7
by: Brad Pears | last post by:
I have something strange going on - pretty sure it used to work before - and now it does not... Why does the following code not clear a combo box? Me.cboLocation.Text = String.Empty OR ...
3
by: Andy B | last post by:
I need to search an xml element for blocks of text. The start of the text block will have a 5 digit number in it and i then need to read until the next 5 digit number. After this, I need to put...
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: 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
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
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
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,...
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.