|
-
Jun 29th, 2004, 04:24 PM
#1
Thread Starter
PowerPoster
ListView SelectedItem Font Change {RESOLVED}
Hi,
Can I change the font of the SelectedItem in a ListView to Bold?
Last edited by taxes; Jun 30th, 2004 at 07:34 PM.
Taxes
The more I learn about VB.NET the more I like dBaseIII Plus
The foregoing, whilst believed to be correct, is given without guarantee as to it's accuracy and entirely without recourse. You are required to decide for yourself whether or not it is suitable for your purposes and no liability for loss of any nature can be entertained.
-
Jun 29th, 2004, 04:57 PM
#2
Addicted Member
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
-
Jun 29th, 2004, 06:34 PM
#3
Thread Starter
PowerPoster
Hi,
Thanks. That's great.
Is there a way to reset the fonts of all the items in the listview to regular?
Taxes
The more I learn about VB.NET the more I like dBaseIII Plus
The foregoing, whilst believed to be correct, is given without guarantee as to it's accuracy and entirely without recourse. You are required to decide for yourself whether or not it is suitable for your purposes and no liability for loss of any nature can be entertained.
-
Jun 30th, 2004, 04:16 PM
#4
Thread Starter
PowerPoster
Bump.
Anyone any ideas please?
Taxes
The more I learn about VB.NET the more I like dBaseIII Plus
The foregoing, whilst believed to be correct, is given without guarantee as to it's accuracy and entirely without recourse. You are required to decide for yourself whether or not it is suitable for your purposes and no liability for loss of any nature can be entertained.
-
Jun 30th, 2004, 07:10 PM
#5
Addicted Member
Code:
Dim item As ListViewItem
For Each item In ListView1.Items
item.ForeColor = ListView1.ForeColor
item.Font = New Font(ListView1.Font, FontStyle.Regular)
Next
-
Jun 30th, 2004, 07:33 PM
#6
Thread Starter
PowerPoster
Hi,
Perfect!
Many thanks.
Taxes
The more I learn about VB.NET the more I like dBaseIII Plus
The foregoing, whilst believed to be correct, is given without guarantee as to it's accuracy and entirely without recourse. You are required to decide for yourself whether or not it is suitable for your purposes and no liability for loss of any nature can be entertained.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|