|
-
Apr 25th, 2004, 12:53 AM
#1
Thread Starter
Addicted Member
ListViewItem.BackColor; Help Needed
Does any body know how to change the backcolor of a ListViewItem and that of a ListViewItem.SubItem.
The BackColor property does not work.
-
Apr 25th, 2004, 04:23 AM
#2
Hyperactive Member
Dear Friend, there is a property that can lock a subitem (UseItemStyleForSubItems ). You must set it to a False value:
Dim Elenco As ListViewItem
Elenco = Me.LswFatture.Items.Add(Me.StrContatto)
If Elenco.Index < 3 Then
Elenco.BackColor = System.Drawing.Color.Red
End If
Elenco.UseItemStyleForSubItems = False
Elenco.SubItems.Add(Me.StrNumDoc)
Elenco.SubItems.Add(Me.StrData)
Elenco.SubItems(1).BackColor = System.Drawing.Color.DarkOrange
In the code above I put a Red color in the first subitem (the first column on the left), for the first 3 rows.
For any rows, I put a background color = DarkOrange on the second column. The effect is awful, but the example is useful I hope
Good job
Live long and prosper (Mr. Spock)
-
Apr 25th, 2004, 02:41 PM
#3
Thread Starter
Addicted Member
Thanx a lot alextyx.
It was quit helpful.
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
|