Results 1 to 5 of 5

Thread: [2.0] passing values by ref..got stuck..

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Oct 2003
    Posts
    436

    [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);
    }
    }

  2. #2
    Arabic Poster ComputerJy's Avatar
    Join Date
    Nov 2005
    Location
    Happily misplaced
    Posts
    2,513

    Re: [2.0] passing values by ref..got stuck..

    Code:
    MSFTChart.CreateChart(ref g01);
    "I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
    My Blog

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Oct 2003
    Posts
    436

    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

  4. #4
    Arabic Poster ComputerJy's Avatar
    Join Date
    Nov 2005
    Location
    Happily misplaced
    Posts
    2,513

    Re: [2.0] passing values by ref..got stuck..

    So, sorry

    Code:
    Chart c=new Chart();
    g01 MSFTChart =new g01();
    MSFTChart.CreateChart(ref c);
    "I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
    My Blog

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Oct 2003
    Posts
    436

    Unhappy 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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width