如何在C#中通过代码设置标题 [英] How to set the title on Chart through Code in C#

查看:214
本文介绍了如何在C#中通过代码设置标题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



如何在C#中设置Windows窗体中的图表标题?我不想在设计器属性中设置它。我希望它在单击按钮时设置。例如:



Hi guys,

How do I set the Title of a chart in Windows Form in C#? I don't want to set it in the designer properties. I want it to set when a button is clicked. For example:

public void button2_click(object sender, EventArgs e)
{
  chart1.Title.Text = "Sales";

}

推荐答案

考虑使用 ChartTitle 属性 - http://msdn.microsoft.com/en- us / library / microsoft.office.tools.excel.chart.charttitle.aspx [ ^ ]。
Consider using the ChartTitle property - http://msdn.microsoft.com/en-us/library/microsoft.office.tools.excel.chart.charttitle.aspx[^].


这篇关于如何在C#中通过代码设置标题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆