Hi,
Can I change the font of the SelectedItem in a ListView to Bold?
Printable View
Hi,
Can I change the font of the SelectedItem in a ListView to Bold?
Yes,
Design Time:
Code:Dim item As ListViewItem
item = New ListViewItem
item.Font = New Font(Me.Font, FontStyle.Bold)
item.Text = "tim"
ListView1.Items.Add(item)
Run Time:
Code:Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim selectedindex As Integer = ListView1.SelectedIndices(0)
ListView1.Items(selectedindex).Font = New Font(Me.Font, FontStyle.Bold)
End Sub
Hi,
Thanks. That's great.
Is there a way to reset the fonts of all the items in the listview to regular?
Bump.
Anyone any ideas please?
Code:Dim item As ListViewItem
For Each item In ListView1.Items
item.ForeColor = ListView1.ForeColor
item.Font = New Font(ListView1.Font, FontStyle.Regular)
Next
Hi,
Perfect!
Many thanks.