Groups | Blog | Home
all groups > vb.net controls > august 2005 >

vb.net controls : format Listview Items


thomasp NO[at]SPAM msala.net
8/6/2005 7:30:43 PM

Can I format the items in a listview differently? Use different fonts and
colors for different item.
VB2005

Thanks,

Thomas

--
Posted via NewsDemon.com - Premium Uncensored Newsgroup Service
------->>>>>>http://www.NewsDemon.com<<<<<<------
Phil
8/6/2005 8:11:53 PM
Yes you can. This control has a listitems property that lets you work with
the individual items.

Rgds, Phil

[quoted text, click to view]

Herfried K. Wagner [MVP]
8/7/2005 12:00:00 AM
<thomasp@msala.net> schrieb:
[quoted text, click to view]

Make sure the row's first item's 'UseItemStyleForSubItems' property is set
to 'False' when assigning different fonts and colors to sub items.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>
thomasp NO[at]SPAM msala.net
8/7/2005 12:00:00 AM
I used this, it seems to be doing what I want.

Dim x As Integer = 0
For Each dsColumn As DataColumn In ds.Tables(0).Columns
lstAvailable.Items.Add(dsColumn.ColumnName)
Select Case dsColumn.ColumnName
Case Is = "Db"
lstAvailable.Items(x).ForeColor = Color.Red
Case Is = "Velocity"
lstAvailable.Items(x).ForeColor = Color.Red
End Select

x += 1
Next

--
Posted via NewsDemon.com - Premium Uncensored Newsgroup Service
------->>>>>>http://www.NewsDemon.com<<<<<<------
AddThis Social Bookmark Button