【问题标题】:Changing the colour of certain ListView columns更改某些 ListView 列的颜色
【发布时间】:2012-05-01 08:54:09
【问题描述】:

如何更改列表视图中特定列的颜色?

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;

【问题讨论】:

标签: c# listview colors items subitem


【解决方案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 ); 

如果您使用数据库绑定它,您可能必须在项目数据绑定过程中执行此操作。如果是这样,请告诉我。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-02-12
    • 2016-03-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多