473,769 Members | 1,736 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1961
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.co m

"news.microsoft .com" <vm> wrote in message
news:eG******** ******@TK2MSFTN GP12.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
2336
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
2766
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 with the word "This" in one color, "is" in another color, and so on? Then in my next row, I'd add another sentence with more different colors. Basically, I'd be changing the text's color dynamically and then adding it to the listview. Is that...
0
1317
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 actioning
3
2678
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 returns a null reference exception if I attempt to use it. I am displaying data that changes in real time and needs to have certain columns update when a separate thread invokes an
6
20039
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
7734
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 the faster var color_speed = 50; //speed at which colors change var smoothing = 8; //the larger the number the less smooth but faster for sliding. var font_smoothing = 1; //lower the number the smoother the font changes.
1
1511
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
3582
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 Me.cboLocation.Text = ""
3
1818
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 them in different containers of their own. Where would I start?
0
9589
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9423
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10047
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9995
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9863
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8872
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6674
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5304
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5447
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.