欧美一区二区三区,国内熟女精品熟女A片视频小说,日本av网,小鲜肉男男GAY做受XXX网站

怎樣修改Listview的ITEM的顏色

錢諍諍2年前69瀏覽0評論

怎樣修改Listview的ITEM的顏色?

一、改變顏色在VB6的ListView控件中,可以改變項目及其子項的前景色、背景色。實現方法如下(1)在窗體上布置一個ListView控件(2)窗體代碼如下Option ExplicitPrivate Sub Form_Load()Dim itemX As ListItemWith ListView1.View = lvwReport.ColumnHeaders.Add , , "類別".ColumnHeaders.Add , , "品名1".ColumnHeaders.Add , , "品名2"Set itemX = .ListItems.Add(, , "水果")itemX.SubItems(1) = "蘋果"itemX.SubItems(2) = "香蕉"ChangeForeColor itemX, &H8000& '墨綠色Set itemX = .ListItems.Add(, , "飲料")itemX.SubItems(1) = "果汁"itemX.SubItems(2) = "可樂"ChangeForeColor itemX, vbRed '紅色Set itemX = .ListItems.Add(, , "文具")itemX.SubItems(1) = "鉛筆"itemX.SubItems(2) = "橡皮"ChangeForeColor itemX, vbBlue '藍色End WithEnd Sub'-------------------------------------' 修改ListView 項的前景色顏色'-------------------------------------Private Sub ChangeForeColor( _ByVal item As ListItem, _ByVal NewColor As Long)'設置項的顏色 item.ForeColor = NewColor'設置所有子項的顏色Dim subItem As ListSubItemFor Each subItem In item.ListSubItemssubItem.ForeColor = NewColorNextEnd Sub(3)運行效果二、改變字體ListView控件中,ListItem以及ListSubItem中沒有字體屬性,所以無法改變單獨某個項或子項的字體;只能改ListView控件的字體。運行效果

css listview,怎樣修改Listview的ITEM的顏色