Home All Groups Group Topic Archive Search About
Author
13 Oct 2005 7:59 PM
Dale
After searching for weeks for a way to highlight different rows in a
Listview with different colors, Google finally turned up your post from
January of 2002, explaining how to do it. I was trying to accomplish it
with background color (a near-impossible task, I surmise), not realizing it
could be done with foreground.

I'm just here to say "Thank you."


--

Dale Beckett

Author
13 Oct 2005 8:20 PM
Martin de Jong
So, where is the party;)))

Martin

Show quoteHide quote
"Dale" <d***@NOT.com> schreef in bericht
news:MPG.1db886c660f477749896cf@news.microsoft.com...
>
>
> After searching for weeks for a way to highlight different rows in a
> Listview with different colors, Google finally turned up your post from
> January of 2002, explaining how to do it. I was trying to accomplish it
> with background color (a near-impossible task, I surmise), not realizing
> it
> could be done with foreground.
>
> I'm just here to say "Thank you."
>
>
> --
>
> Dale Beckett
Author
13 Oct 2005 8:42 PM
Saga
Do you have a link to that message?

I had to do the same thing and also spent some time on it.
I also finally found the answer (somewhere :-S). It was
done thourgh subclassing. I wonder if it is the same method
that Ken describes.

Thanks
Saga

Show quoteHide quote
"Dale" <d***@NOT.com> wrote in message
news:MPG.1db886c660f477749896cf@news.microsoft.com...
>
>
> After searching for weeks for a way to highlight different rows in a
> Listview with different colors, Google finally turned up your post
> from
> January of 2002, explaining how to do it. I was trying to accomplish
> it
> with background color (a near-impossible task, I surmise), not
> realizing it
> could be done with foreground.
>
> I'm just here to say "Thank you."
>
>
> --
>
> Dale Beckett
Author
13 Oct 2005 9:16 PM
Dale
Saga alleged...
>
> Do you have a link to that message?
>
> I had to do the same thing and also spent some time on it.
> I also finally found the answer (somewhere :-S). It was
> done thourgh subclassing. I wonder if it is the same method
> that Ken describes.
>
> Thanks
> Saga
> []


No, there is no subclassing involved, just a rewrite of the method used to
populate my Listview. I would still prefer to be able to fiddle with the
background color on a row by row basis, but this works very well.

Here's the link (this is going to wrap a lot):

http://groups.google.com/group/microsoft.public.vb.general.discussion/brows
e_thread/thread/fd0b1f09f03164/49b398170c907f0%2349b398170c907f0?
sa=X&oi=groupsr&start=2&num=3

--

Dale Beckett
Author
13 Oct 2005 9:39 PM
Saga
Thanks! I'll have a look

Saga

Show quoteHide quote
"Dale" <d***@NOT.com> wrote in message
news:MPG.1db898ca76521f6c9896d0@news.microsoft.com...
> Saga alleged...
>>
>> Do you have a link to that message?
>>
>> I had to do the same thing and also spent some time on it.
>> I also finally found the answer (somewhere :-S). It was
>> done thourgh subclassing. I wonder if it is the same method
>> that Ken describes.
>>
>> Thanks
>> Saga
>> []
>
>
> No, there is no subclassing involved, just a rewrite of the method
> used to
> populate my Listview. I would still prefer to be able to fiddle with
> the
> background color on a row by row basis, but this works very well.
>
> Here's the link (this is going to wrap a lot):
>
> http://groups.google.com/group/microsoft.public.vb.general.discussion/brows
> e_thread/thread/fd0b1f09f03164/49b398170c907f0%2349b398170c907f0?
> sa=X&oi=groupsr&start=2&num=3
>
> --
>
> Dale Beckett
Author
13 Oct 2005 9:25 PM
Ken Halter
Show quote Hide quote
"Dale" <d***@NOT.com> wrote in message
news:MPG.1db886c660f477749896cf@news.microsoft.com...
>
>
> After searching for weeks for a way to highlight different rows in a
> Listview with different colors, Google finally turned up your post from
> January of 2002, explaining how to do it. I was trying to accomplish it
> with background color (a near-impossible task, I surmise), not realizing
> it
> could be done with foreground.
>
> I'm just here to say "Thank you."
>
>
> --
>
> Dale Beckett

You're welcome! :-)

If you're still interested in changing background colors (and don't mind
using some fairly hard-core methods to achieve the effect), see:

CustomDrawLV Demo
"This project shows how to display any row, item or subitem in a listview
control in a different color than the rest of the rows by subclassing the
NM_CUSTOMDRAW message that is sent to the parent of the listview before each
item is drawn."
http://www.mvps.org/vbvision/Sample_Projects.htm#CustomDrawLV_Demo


--
Ken Halter - MS-MVP-VB - http://www.vbsight.com
DLL Hell problems? Try ComGuard - http://www.vbsight.com/ComGuard.htm
Please keep all discussions in the groups..
Author
13 Oct 2005 9:39 PM
Saga
I believe that that is the method I used.

Beware though, if it is, VB crashes horribly whenever the application
exits without resetting (or releasing) the hook that is used to draw the
background. (My terminology might be off, it was while back that I
did this.)

Saga

Show quoteHide quote
"Ken Halter" <Ken_Halter@Use_Sparingly_Hotmail.com> wrote in message
news:%23gvwfyD0FHA.2312@TK2MSFTNGP14.phx.gbl...
> "Dale" <d***@NOT.com> wrote in message
> news:MPG.1db886c660f477749896cf@news.microsoft.com...
>>
>>
>> After searching for weeks for a way to highlight different rows in a
>> Listview with different colors, Google finally turned up your post
>> from
>> January of 2002, explaining how to do it. I was trying to accomplish
>> it
>> with background color (a near-impossible task, I surmise), not
>> realizing it
>> could be done with foreground.
>>
>> I'm just here to say "Thank you."
>>
>>
>> --
>>
>> Dale Beckett
>
> You're welcome! :-)
>
> If you're still interested in changing background colors (and don't
> mind using some fairly hard-core methods to achieve the effect), see:
>
> CustomDrawLV Demo
> "This project shows how to display any row, item or subitem in a
> listview control in a different color than the rest of the rows by
> subclassing the NM_CUSTOMDRAW message that is sent to the parent of
> the listview before each item is drawn."
> http://www.mvps.org/vbvision/Sample_Projects.htm#CustomDrawLV_Demo
>
>
> --
> Ken Halter - MS-MVP-VB - http://www.vbsight.com
> DLL Hell problems? Try ComGuard - http://www.vbsight.com/ComGuard.htm
> Please keep all discussions in the groups..
>
Author
13 Oct 2005 10:09 PM
alpine
If you implement a debug hook for when you are running in the IDE, you
can alleviate a large amount of the problems associated with
subclassing.  The only thing you need to remember is to not use the
Stop button to stop the project.  You really shouldn't use it anyway
except for when you are debugging and AxEXE/DLL.

HTH,
Bryan
_______________________________
Bryan Stafford
New Vision Software
newvision_don'tspam@mvps.org


Show quoteHide quote
On Thu, 13 Oct 2005 16:39:11 -0500, "Saga" <antiSpam@somewhere.com>
wrote:

>
>I believe that that is the method I used.
>
>Beware though, if it is, VB crashes horribly whenever the application
>exits without resetting (or releasing) the hook that is used to draw the
>background. (My terminology might be off, it was while back that I
>did this.)
>
>Saga
>
>"Ken Halter" <Ken_Halter@Use_Sparingly_Hotmail.com> wrote in message
>news:%23gvwfyD0FHA.2312@TK2MSFTNGP14.phx.gbl...
>> "Dale" <d***@NOT.com> wrote in message
>> news:MPG.1db886c660f477749896cf@news.microsoft.com...
>>>
>>>
>>> After searching for weeks for a way to highlight different rows in a
>>> Listview with different colors, Google finally turned up your post
>>> from
>>> January of 2002, explaining how to do it. I was trying to accomplish
>>> it
>>> with background color (a near-impossible task, I surmise), not
>>> realizing it
>>> could be done with foreground.
>>>
>>> I'm just here to say "Thank you."
>>>
>>>
>>> --
>>>
>>> Dale Beckett
>>
>> You're welcome! :-)
>>
>> If you're still interested in changing background colors (and don't
>> mind using some fairly hard-core methods to achieve the effect), see:
>>
>> CustomDrawLV Demo
>> "This project shows how to display any row, item or subitem in a
>> listview control in a different color than the rest of the rows by
>> subclassing the NM_CUSTOMDRAW message that is sent to the parent of
>> the listview before each item is drawn."
>> http://www.mvps.org/vbvision/Sample_Projects.htm#CustomDrawLV_Demo
>>
>>
>> --
>> Ken Halter - MS-MVP-VB - http://www.vbsight.com
>> DLL Hell problems? Try ComGuard - http://www.vbsight.com/ComGuard.htm
>> Please keep all discussions in the groups..
>>
>
Author
14 Oct 2005 2:53 PM
Saga
Thanks Alpine, I'll keep these points in mind :-)

Saga

Show quoteHide quote
"alpine" <alpine_don'tsendspam@mvps.org> wrote in message
news:8imtk1drj0bihltvq9eonli8nb8tpesoum@4ax.com...
> If you implement a debug hook for when you are running in the IDE, you
> can alleviate a large amount of the problems associated with
> subclassing.  The only thing you need to remember is to not use the
> Stop button to stop the project.  You really shouldn't use it anyway
> except for when you are debugging and AxEXE/DLL.
>
> HTH,
> Bryan
> _______________________________
> Bryan Stafford
> New Vision Software
> newvision_don'tspam@mvps.org
>
>
> On Thu, 13 Oct 2005 16:39:11 -0500, "Saga" <antiSpam@somewhere.com>
> wrote:
>
>>
>>I believe that that is the method I used.
>>
>>Beware though, if it is, VB crashes horribly whenever the application
>>exits without resetting (or releasing) the hook that is used to draw
>>the
>>background. (My terminology might be off, it was while back that I
>>did this.)
>>
>>Saga
>>
>>"Ken Halter" <Ken_Halter@Use_Sparingly_Hotmail.com> wrote in message
>>news:%23gvwfyD0FHA.2312@TK2MSFTNGP14.phx.gbl...
>>> "Dale" <d***@NOT.com> wrote in message
>>> news:MPG.1db886c660f477749896cf@news.microsoft.com...
>>>>
>>>>
>>>> After searching for weeks for a way to highlight different rows in
>>>> a
>>>> Listview with different colors, Google finally turned up your post
>>>> from
>>>> January of 2002, explaining how to do it. I was trying to
>>>> accomplish
>>>> it
>>>> with background color (a near-impossible task, I surmise), not
>>>> realizing it
>>>> could be done with foreground.
>>>>
>>>> I'm just here to say "Thank you."
>>>>
>>>>
>>>> --
>>>>
>>>> Dale Beckett
>>>
>>> You're welcome! :-)
>>>
>>> If you're still interested in changing background colors (and don't
>>> mind using some fairly hard-core methods to achieve the effect),
>>> see:
>>>
>>> CustomDrawLV Demo
>>> "This project shows how to display any row, item or subitem in a
>>> listview control in a different color than the rest of the rows by
>>> subclassing the NM_CUSTOMDRAW message that is sent to the parent of
>>> the listview before each item is drawn."
>>> http://www.mvps.org/vbvision/Sample_Projects.htm#CustomDrawLV_Demo
>>>
>>>
>>> --
>>> Ken Halter - MS-MVP-VB - http://www.vbsight.com
>>> DLL Hell problems? Try ComGuard -
>>> http://www.vbsight.com/ComGuard.htm
>>> Please keep all discussions in the groups..
>>>
>>
>
Author
13 Oct 2005 11:00 PM
Dale
Ken Halter alleged...
Show quoteHide quote
> "Dale" <d***@NOT.com> wrote in message
> news:MPG.1db886c660f477749896cf@news.microsoft.com...
> >[]
>
> You're welcome! :-)
>
> If you're still interested in changing background colors (and don't mind
> using some fairly hard-core methods to achieve the effect), see:
>
> CustomDrawLV Demo
> "This project shows how to display any row, item or subitem in a listview
> control in a different color than the rest of the rows by subclassing the
> NM_CUSTOMDRAW message that is sent to the parent of the listview before each
> item is drawn."
> http://www.mvps.org/vbvision/Sample_Projects.htm#CustomDrawLV_Demo
>
>
>


Now THAT looks like what I was trying to do! I'll try to wade through it,
see if I can understand it, and see if I can adapt it to my own project.

Thanks AGAIN!

--

Dale Beckett
Author
13 Oct 2005 9:32 PM
DanS
Dale <d***@NOT.com> wrote in
news:MPG.1db886c660f477749896cf@news.microsoft.com:

>
>
> After searching for weeks for a way to highlight different rows in a
> Listview with different colors, Google finally turned up your post
> from January of 2002, explaining how to do it. I was trying to
> accomplish it with background color (a near-impossible task, I
> surmise), not realizing it could be done with foreground.
>
> I'm just here to say "Thank you."
>
>

I've _really_ got to get my custom api listview into a class or a user
control so i can let anyone who needs it use it, but it is a 'details' view
only lv.