Formatting Text in ListView 
Author Message
 Formatting Text in ListView

Hello,

I was wondering if it is posible to change the color of only part of the
text in one cell of a ListView. eg.
svrList.Items.Add("this will be one color..............this is another");
where "this is another" is a different color to "this will be one color". Is
this posible at all?

Thanks,

James



Thu, 14 Apr 2005 07:21:20 GMT  
 Formatting Text in ListView
Hi James,

You need to subclass the ListView class and draw the header yourself.

Here is an sample from
http://www.codeproject.com/cs/miscctrl/SortedListView.asp.  It is a
customized Listview in which you can see how to customize header items. You
may find some useful clues that can help in your project.

Hope this helps.

Regards,

Felix Wu
=============
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------

Quote:

>Newsgroups: microsoft.public.dotnet.languages.CSharp
>Subject: Formatting Text in ListView
>Date: Sun, 27 Oct 2002 00:21:20 +0100
>Organization: Posted via Supernews, http://www.supernews.com

>X-Priority: 3
>X-MSMail-Priority: Normal
>X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
>X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106

>Lines: 13
>Path:

cpmsftngxa09!cpmsftngxa06!tkmsftngp01!cppssbbsa01.microsoft.com!news-out.cwi
x.com!newsfeed.cwix.com!opentransit.net!newsfeed.online.be!sn-xit-05!sn-xit-
06!sn-post-01!supernews.com!corp.supernews.com!not-for-mail
Quote:
>Xref: cpmsftngxa09 microsoft.public.dotnet.languages.csharp:102940
>X-Tomcat-NG: microsoft.public.dotnet.languages.csharp

>Hello,

>I was wondering if it is posible to change the color of only part of the
>text in one cell of a ListView. eg.
>svrList.Items.Add("this will be one color..............this is another");
>where "this is another" is a different color to "this will be one color".
Is
>this posible at all?

>Thanks,

>James



Sat, 16 Apr 2005 14:51:35 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. How to save a file in Microsoft word format(.doc) or Rich text format

2. Saving a richtext format to a standard text format

3. Converting text string to formatted text

4. Need help on save texts format by Textout to a text file

5. formatting text into a text file

6. Converting text string to formatted text

7. ListView: Formatting a date according to Regional Settings?

8. ListView control with long text...

9. Changing text color in listview

10. mutiline text in listview item

11. Listview subitem text not showing

12. Help changing text color in a ListView control

 

 
Powered by phpBB® Forum Software