Hi,
I'm displaying search results in a listview control and I want to highlight or at least make the searched text bold in the listview items and subitems. Can anyone help please?
Thanks,
Ruki76
Loading
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Jayadev Nair20 reputationPosted Apr 6, 2006, 7:00 AM EDT
Regards!
Rukshan Salgado14 reputationPosted Apr 6, 2006, 8:24 AM EDT
Craig MurphyRank #2,956 · 488 reputationPosted Apr 6, 2006, 12:37 PM EDT
It's a little bit more than a few lines of code, but there is a good example here:
http://msdn2.microsoft.com/en-us/library/system.windows.forms.listview.ownerdraw(VS.80).aspx
HTH
Rukshan Salgado14 reputationPosted Apr 7, 2006, 12:20 AM EDT
Thanks for the tip, but I'm still using ver 1.1. Let me know if U come across something else.
Craig MurphyRank #2,956 · 488 reputationPosted Apr 7, 2006, 12:58 AM EDT
More code then, sorry!
Read more about what's required here:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/commctls/custdraw/custdraw.asp
I realise you need a ListView, but there's a TreeView implementation here:
http://www.codeproject.com/vb/net/CustomDrawTreeview.asp
It might give you some pointers that help...
Rukshan Salgado14 reputationPosted Apr 10, 2006, 1:00 AM EDT
Thank you for the tips, but I'm a bit lost with the code since it's done for a Treeview.
I appreciate if U could help me further on this.
Thanks