Highlight or bold only the selected text in a List view Items and sub items?

Ruki76

New member
Joined
Apr 16, 2006
Messages
1
Programming Experience
3-5
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.
I understand this has to be done by extending the listview control.
Can anyone help please?

Thanks,

Ruki
 
VB.NET:
[FONT=Courier New]If lvUpdate.SelectedItems.Count > 0 Then [/FONT]
[FONT=Courier New]For Each lv As ListViewItem In lvUpdate.Items [/FONT]
[FONT=Courier New]  lv.Font = New Font(lv.Font, FontStyle.Regular) [/FONT]
[FONT=Courier New]Next [/FONT]
[FONT=Courier New]Dim lvi As ListViewItem = New ListViewItem [/FONT]
[FONT=Courier New]lvi = lvUpdate.SelectedItems(0) [/FONT]
[FONT=Courier New]lvi.Font = New Font(lvi.Font, FontStyle.Bold) [/FONT]
[FONT=Courier New]End If[/FONT]
 
Last edited by a moderator:
Back
Top