Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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

  • Leaders
Posted

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)

  • Leaders
Posted

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.

Posted

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.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...