[2.0] passing values by ref..got stuck..
I have downloaded a chart control (upon suggestion of one of this board member ).
I am trying to call this chart control and I am not able to progress. can some one take a look at this?
the code in the chart control is like this. this is downloaded code and not mine.
public class g01
{
public g01()
{
}
public void CreateChart(ref Chart chart1)
{
// Set the title.
chart1.Title="My Chart";
}
I wrote this code that calls this CreateChart method. But I don't know how to pass parameters to CreateChart method.
class Program
{
static void Main(string[] args)
{
g01 MSFTChart = new g01();
///next line I am stuck.
MSFTChart.CreateChart(ref Chart);
}
}
Re: [2.0] passing values by ref..got stuck..
Code:
MSFTChart.CreateChart(ref g01);
Re: [2.0] passing values by ref..got stuck..
I wrote your code "MSFTChart.CreateChart(ref g01);"
I get the following error
'dotnetChartingSamples.g01' is a 'type' but is used like a 'variable'
what does it mean?
thanks
nath
Re: [2.0] passing values by ref..got stuck..
So, sorry
Code:
Chart c=new Chart();
g01 MSFTChart =new g01();
MSFTChart.CreateChart(ref c);
Re: [2.0] passing values by ref..got stuck..
It works as you said.
but I don't see a chart control in the tool box when I installed free chart control. I downloaded from the following site.
http://www.softwarefx.com/GetChartFXLite/
Unless I have a chart control on my windows form, I won't be able to display the contents of the chart.
where can I search and add as a reference?
thanks
nath