不能更改TopLeftHeaderCell的backColor吗?!!! [英] Cant Change backColor of TopLeftHeaderCell?!!!
本文介绍了不能更改TopLeftHeaderCell的backColor吗?!!!的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
我无法为datagridview的列标题中的单元格着色:
我从文档中了解到类似这样的方法应该起作用,
但这不起作用...
Hi all,
I can''t manage to color the cell in the column header of a datagridview:
I understand from the documentation that something like this should work,
but it doesn''t work...
DataGridView1.TopLeftHeaderCell.Style.BackColor = System.Drawing.Color.Blue;
谢谢,
Thanks,
推荐答案
引用该线程,可能会对您有所帮助
http://social.msdn.microsoft.com/Forums/en/winforms/thread/99ff99e5-739e-4f42-91fe-bbb65c411504 [
Refer this thread, might help you
http://social.msdn.microsoft.com/Forums/en/winforms/thread/99ff99e5-739e-4f42-91fe-bbb65c411504[^]
您的代码很好,但我认为其他代码块中可能存在问题(您没有提供完整的代码),请检查这些
Windows窗体DataGridView控件中的列填充模式 [ ^ ]
如何:在Windows Forms DataGridView控件中设置字体和颜色样式 [
Your code is fine but I think there may be issue in other code-block(You didn''t include the full code), check these
Column Fill Mode in the Windows Forms DataGridView Control[^]
How to: Set Font and Color Styles in the Windows Forms DataGridView Control[^]
实际上我的代码有问题...对不起,它起作用了:
DataGridView1.TopLeftHeaderCell.Style.BackColor = System.Drawing.Color.Blue;
Actually my code had a problem ...sorry it works:
DataGridView1.TopLeftHeaderCell.Style.BackColor = System.Drawing.Color.Blue;
这篇关于不能更改TopLeftHeaderCell的backColor吗?!!!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文