-->

某些更改的ListView列的颜色(Changing the colour of certain L

2019-09-16 15:02发布

我怎样才能改变一个特定的列的列表视图的颜色?

string[] row = { appID[i], "Launch Game"}; // more data to add

listView1.Items.Add(nameArray[i], i).SubItems.AddRange(row);

listView1.ForeColor = System.Drawing.Color.Blue;

Answer 1:

尝试是这样的:

ListViewItem item1 = new ListViewItem( "Item 1"); 
item1.SubItems.Add( "Color" ); 
item1.SubItems[1].ForeColor = System.Drawing.Color.Blue;
item1.UseItemStyleForSubItems = false; 
listView1.Items.Add( item1 ); 

如果你正在使用的数据库绑定它,你可能对项目数据绑定过程中,要做到这一点。 让我知道,如果是这样的话。



文章来源: Changing the colour of certain ListView columns