|
-
May 22nd, 2006, 09:35 AM
#1
Thread Starter
Fanatic Member
Listview Help
Can anyone help - Is it possible to have list items within a list view shown in different colours and/or in bold.
ie. Item 1 ="This Entry is Red and Is in Boldface"
Item 2 ="This entry is black in normal text"
etc.
I am trying to replicate a telephone book where the main entry is in bold and may be coloured either red or black, consecutive entries are normal text and are black.
-
May 22nd, 2006, 09:42 AM
#2
Re: Listview Help
Martin Liss, Post #4, here
-
May 22nd, 2006, 09:49 AM
#3
Junior Member
Re: Listview Help
 Originally Posted by KenBZim
Can anyone help - Is it possible to have list items within a list view shown in different colours and/or in bold.
ie. Item 1 ="This Entry is Red and Is in Boldface"
Item 2 ="This entry is black in normal text"
etc.
I am trying to replicate a telephone book where the main entry is in bold and may be coloured either red or black, consecutive entries are normal text and are black.
I think this may work:
VB Code:
'first Add ColumnHeaders, then add listitems
'lv used below is a ListView
Dim ItemX As ListItem
dim iItemNum 'Number you try to add
iItemNum=100
Dim j
For i = 0 To iItemNum - 1
Set ItemX = lv.ListItems.Add
ItemX.Text = "Number " & Cstr(i)
if i mod 2 =0 then
ItemX.Bold = True
ItemX.ForeColor = vbBlue
else
ItemX.Bold=False
ItemX.ForeColor=vbBlack
end if
'Add ListSubItems
Next
It may work
-
May 22nd, 2006, 10:28 AM
#4
Thread Starter
Fanatic 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
|