What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » VB Win32 Coding - Listview

VB Win32 Coding - Listview
Author: Message:
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
O.P. VB Win32 Coding - Listview
Ok so I have a listview box with contacts from my contact list added. Now some of them have Messenger Plus! formatted code in their names. What I am wanting to do is using the Win32 API to colour the text appropriatly. I can colour the specific line all one colour but I want to do individual text if need be.

So if anyone can help me out with it that would be great.

* matty stares at Cook :|
10-05-2005 08:21 PM
Profile E-Mail PM Find Quote Report
CookieRevised
Elite Member
*****

Avatar

Posts: 15517
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: VB Win32 Coding - Listview
well, ermmm... you're going to need to totally subclass your listview and make it owner drawn because you are going to need to draw the individual items yourself instead of letting Windows do the job.

This is no small task to do (especially considering the listview is one of the biggest Windows controls with the most possible messages and what not); making a control owner drawn is not that difficult, but handling the messages appropiatly is.

I never attempted to make subtext colored, in another font and all, so I don't have a concrete example for this. But maybe some of these can get you started:
http://www.vbaccelerator.com/home/VB/Code/Control...stView/article.asp
http://www.mvps.org/vbvision/
http://www.elitevb.com/content/01,0048,01/
ListView Ref

I never seen an example on the net which let you colorize and customize parts of items in a listview, they all do it to the whole item text (but mind the sometimes many -hidden- bugs in online examples).

I assume drawing mixed colorized text and all will also involve some GDI (font) stuff so you need to look into that also...

This post was edited on 10-05-2005 at 11:06 PM by CookieRevised.
.-= A 'frrrrrrrituurrr' for Wacky =-.
10-05-2005 11:02 PM
Profile PM Find Quote Report
RaceProUK
Elite Member
*****

Avatar

Posts: 6073
Reputation: 57
39 / Male / Flag
Joined: Oct 2003
RE: VB Win32 Coding - Listview
ListView supports RTF (obviously), so is it possible to get an ITextServices for each item?
[Image: spartaafk.png]
10-06-2005 01:15 PM
Profile PM Web Find Quote Report
CookieRevised
Elite Member
*****

Avatar

Posts: 15517
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: VB Win32 Coding - Listview
quote:
Originally posted by raceprouk
ListView supports RTF (obviously), so is it possible to get an ITextServices for each item?
We're talking VB here, not C++ where you use the Windows listview. If you use the listview from the windows common controls library, then yes, if you use the listview from the ActiveX common library then no... The basic VB controls do not support RTF or unicode. Nevertheless, even in C++ you must make the listview owner drawn to be able to do this stuff as Windows does not support such things by itself; you need to program it (AFAIK).

This post was edited on 10-06-2005 at 01:53 PM by CookieRevised.
.-= A 'frrrrrrrituurrr' for Wacky =-.
10-06-2005 01:51 PM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On