Shaddow Posted January 8, 2004 Posted January 8, 2004 I want to be able to color the first column like a hyperlink and leave the rest of them alone. I can acheive the coloring of the full deal by: .Font = New Font("Courier new", 10, FontStyle.Underline) .ForeColor = Color.MediumBlue on a ListView Item. But I only want the one column changed.... any suggestions? R Quote
Leaders dynamic_sysop Posted January 8, 2004 Leaders Posted January 8, 2004 check " UseItemStyleForSubItems " like this .... Dim lvi As New ListViewItem("main item") Dim lvs As New ListViewItem.ListViewSubItem(lvi, "subitem") lvi.Font = New Font("Tahoma", ListView1.Font.Size, FontStyle.Underline) lvi.ForeColor = Color.Blue lvi.UseItemStyleForSubItems = False '/// stop the font's remaining the same. lvi.SubItems.Add(lvs) ListView1.Items.Add(lvi) Quote
samsmithnz Posted January 8, 2004 Posted January 8, 2004 On a slightly related note, can you color individual rows too? Quote Thanks Sam http://www.samsmith.co.nz
Leaders dynamic_sysop Posted January 8, 2004 Leaders Posted January 8, 2004 you can colour each listview item / subitem individually. if you wanted to colour a row as in a column you would probably have to loop through each column and set the colours depending on column. Quote
Shaddow Posted January 8, 2004 Author Posted January 8, 2004 ok. HOW? I will have to do such in the near future. I liked the lvi.UseItemStyleForSubItems = False worked great. but how do I get to the individual subcells. lvi.font etc worked for the item but lvi.subitems..... doesn't allow the font change the same way (or at least I seem to be missing it. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.