Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何更改列表视图中特定列的颜色?
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;
尝试这样的事情:
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 );
如果您使用数据库绑定它,您可能必须在项目数据绑定过程中执行此操作。让我知道是否是这种情况。