更改zedgraph窗格的背景色 [英] Change zedgraph pane background color
问题描述
是否可以更改zedgraph窗格的背景颜色(默认为白色)?
Is it possible to change the background color (white by default) of a zedgraph pane?
我尝试更改zedgraph元素的背景颜色,但是它没有任何可见的结果,背景仍然是白色的:
I tried changing the background color of the zedgraph element, but it doesn't give any visible result, background is still white:
ZedGraphControl.BackColor = System.Drawing.Color.Black;
在 ZedGraphControl.GraphPane
上似乎不存在 Color
或 BackColor
属性.
And there doesn't seem to exist a Color
or BackColor
property on ZedGraphControl.GraphPane
.
推荐答案
您可以使用
zg.GraphPane.Chart.Fill.Color = SystemColors.ControlText;
[仅]更改图表的背景.如果要更改图表以外的zedgraph的背景色,请使用
to change the background [only] of the chart. If you want to change the background color the zedgraph except the chart, use
zg.GraphPane.Fill.Color = SystemColors.ControlText;
如果要更改zedgraph中所有内容的背景色,请同时使用以下两种方法:
If you want to change the background color of everything in the zedgraph, use both:
zg.GraphPane.Chart.Fill.Color = SystemColors.ControlText;
zg.GraphPane.Fill.Color = SystemColors.ControlText;
我知道您已经解决了您的问题,但是我这样做是为了让有人搜索它,他可以迅速解决他的问题:)
I know that you already solved your problem but I made this so if someone searches it, he can solve his problem quickly :)
这篇关于更改zedgraph窗格的背景色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!