|
-
Aug 28th, 2003, 12:03 PM
#1
Thread Starter
Addicted Member
Set font, color for ListviewItem? [resolved]
PHP Code:
Dim lViewItem As New ListViewItem()
lViewItem.SubItems.Add(chr(252), System.Drawing.Color.Red, System.Drawing.Color.Green, New System.Drawing.Font("Wingdings", 10))
Me.myListView.Items.Add(lViewItem)
Why doesn't this work?
I get the chr(252) character of the default font (MS Sans) and the background and foreground are the default (white/black) colors?
The background/foreground isn't important and I will change them back to white/black, but even that isn't working.
thanks,
Last edited by Shurijo; Aug 29th, 2003 at 10:13 AM.
-Shurijo
-
Aug 28th, 2003, 04:03 PM
#2
Thread Starter
Addicted Member
Ok. I found out that I have to set the entire Item to the same background, foreground, font properties. A subitem (even thou it is possible via code) cannot have different properties than the item.
So this isn't "resolved", it's just impossible (unless using a custom control, etc.).
-
Aug 28th, 2003, 06:37 PM
#3
Lively Member
By default the listview subitems use the same font, style & color as the listitem to turn it off, do it like this.....
Code:
itm.UseItemStyleForSubItems = False
itm.SubItems(1).Font = New Font("Tahoma", 9.0!, _
System.Drawing.FontStyle.Italic)
I'll leave the rest up to you to work out.
-
Aug 29th, 2003, 10:13 AM
#4
Thread Starter
Addicted Member
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
|