Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > General > Color'd Listview Text


Reply
 
Thread Tools Display Modes
  #1  
Old 09-07-2005, 11:57 PM
silver_shot's Avatar
silver_shot silver_shot is offline
Junior Contributor
 
Join Date: Jan 2004
Location: London, UK
Posts: 287
Default Color'd Listview Text


Title says it all really. Is it possible to color different pats of text in a listview for example like:

RedGreenBlue txt | Pink txt | Orange txt
Red txt | Blue txt| Green txt

Thanks for any help.
__________________
It takes a team to create an Operating System, but one God to create the universe. - SilverShot

Last edited by silver_shot; 09-07-2005 at 11:58 PM. Reason: Title
Reply With Quote
  #2  
Old 09-08-2005, 04:08 AM
Peperl's Avatar
Peperl Peperl is offline
Senior Contributor
 
Join Date: Apr 2003
Location: Cartagena, Spain
Posts: 1,371
Default

Hi

i don't know if you refer to this, create a new project, place a List View control on the form, and place this code on the Form_Load event

Code:
' lv is the name of the listview lv.ListItems.Add(, , "element1").ForeColor = vbRed lv.ListItems.Add(, , "element2").ForeColor = vbGreen

Is this what are you asking for?
__________________
Pri Oh Persia
Reply With Quote
  #3  
Old 09-08-2005, 10:09 AM
silver_shot's Avatar
silver_shot silver_shot is offline
Junior Contributor
 
Join Date: Jan 2004
Location: London, UK
Posts: 287
Default

Sorry I didn't say it clear. For example 1 item has the text "Hello world". I would like to colour 'Hello' in red and 'World' in blue. Is it possible?
__________________
It takes a team to create an Operating System, but one God to create the universe. - SilverShot
Reply With Quote
  #4  
Old 09-08-2005, 10:21 AM
Peperl's Avatar
Peperl Peperl is offline
Senior Contributor
 
Join Date: Apr 2003
Location: Cartagena, Spain
Posts: 1,371
Default

Ummm ... i think no ... at least i don't know how to do it

Maybe with subclassing, but i am not sure
__________________
Pri Oh Persia
Reply With Quote
  #5  
Old 09-08-2005, 10:22 AM
silver_shot's Avatar
silver_shot silver_shot is offline
Junior Contributor
 
Join Date: Jan 2004
Location: London, UK
Posts: 287
Default

Okthanks very much, I shall use a RTB instead. =)
__________________
It takes a team to create an Operating System, but one God to create the universe. - SilverShot
Reply With Quote
  #6  
Old 09-08-2005, 10:24 AM
Peperl's Avatar
Peperl Peperl is offline
Senior Contributor
 
Join Date: Apr 2003
Location: Cartagena, Spain
Posts: 1,371
Default

For Big problems ... Big solutions (like we say here in Spain)
__________________
Pri Oh Persia
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->