【问题标题】:Change header and column colours and font using HeaderFormatStyle in ObjectListView使用 ObjectListView 中的 HeaderFormatStyle 更改标题和列的颜色和字体
【发布时间】:2014-10-15 07:15:36
【问题描述】:

使用 ObjectListView 我该怎么做:

更改列标题以及列本身的背景颜色、前景颜色和字体属性。

我看过这里,但它没有解释如何以编程方式或在 IDE 中正确地解释它:

http://objectlistview.sourceforge.net/cs/recipes.html#how-do-i-change-the-font-or-color-of-the-column-headers

【问题讨论】:

  • 据我所知,它确实充分解释了它。您对描述的哪一部分有理解困难?
  • 我试过这个:OLVColumn.HeaderFormatStyle.SetBackColor(Color.Red);但这并没有做任何事情;我在 OLVColumn.AspoectGetter 里面做了这个
  • 更具体地说:HearderFormatStyle h = new HeaderFormatStyle(); h.SetBackColor(Color.Red); olvColumn.HeaderFormatStyle = h;
  • 对不起,我没有意识到我需要将 headerThemes 切换为 false
  • @azuric 如果您找到了解决方案,请发布并接受它;)或者如果您愿意,您也可以删除问题

标签: c# objectlistview


【解决方案1】:

将 headerThemes 切换为 false 后,您可以更改背景颜色、前景色和字体属性。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2019-06-06
    • 1970-01-01
    • 1970-01-01
    • 2015-10-29
    • 2023-03-09
    • 2015-03-25
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多