如何删除ZedGraph控件的灰色边框?
图表应该在表单中,没有灰色边框,标签和标题。
我尝试用
来解决问题_zgc.MasterPane.Border.Width = 0;
_zgc.MasterPane.Border.IsVisible = false;
但现在没有成功。
答案 0 :(得分:1)
解决方案是:
GraphPane _gp = _zgc.GraphPane;
_gp.Margin.All = 0;
_gp.Legend.IsVisible = false;
_gp.Title.IsVisible = false;
答案 1 :(得分:0)
问题是您使用的是Masterpane而不是Graphpane。
_zgc.GraphPane.Border.IsVisible = false;
_zgc.GraphPane.Legend.IsVisible = false;
_zgp.GraphPane.Title.IsVisible = false;
答案 2 :(得分:0)
如果您想隐藏除图表内容以外的所有内容:
zedGraph.GraphPane.Title.IsVisible = false;
zedGraph.GraphPane.XAxis.IsVisible = false;
zedGraph.GraphPane.YAxis.IsVisible = false;
zedGraph.GraphPane.Border.IsVisible = false;
zedGraph.GraphPane.Chart.Border.IsVisible = false;
您还可以消除图表窗格和控件边框之间的间隙:
zedGraph.GraphPane.Margin.All = -1;