adding text of different colors in listview

  • Thread starter Thread starter VM
  • Start date Start date
V

VM

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 possible?
Thanks.
 
Hi VM,

Thank you for posting in the community! My name is Jeffrey, and I will be
assisting you on this issue.

Based on my understanding, you want to control the color of different
string parts in one ListView item.
=========================================================
Acutally, .Net WinForm control ListView encapluate the win32 control
List-View, but it does not support this feature of setting.
ListView class does expose this function for developer.

But, I think maybe you can get this done through P/invoke and do custom
draw in Win32 layer.

For more information about custom draw, please refer to the article below:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/pla
tform/commctls/custdraw/custdraw.asp

=========================================================
Thank you for your patience and cooperation. If you have any questions or
concerns, please feel free to post it in the group. I am standing by to be
of assistance.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
Don't think so. You can change the font and colors of the individual cell
but to my knowledge they behave like textboxes, ie it's all text or no
text that you can change.
 
Hi VM,

Do you still have any concern?
Please feel free to tell me, I will work with you.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
Back
Top