Static hosting routine causes Object Reference error

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
tirby
Newbie
Newbie
Posts: 84
Joined: Mon Mar 16, 2009 12:00 am

Static hosting routine causes Object Reference error

Post by tirby » Wed Nov 20, 2013 4:26 pm

Hi!

If i set a routine (that resides in a form) to static, tChart.whatever generates an error.
'An object reference is required for the non-static field, method or property 'PostJobPlot.Form1.tChart1'.

Frankly, I have no clue how to resolve this. I have searched this site as well as many, many other sites, and cannot come up with a solution.
I believe its a matter of configuration and is probably not difficult, but nonetheless, I'm lost!

Code: Select all

namespace PostJobPlot
{
    public partial class Form1 : Form
    {.....



        public static void LoadActualArrayItem(int ItemIndex)
        {
            int aa = 0;
            int bb = 0;
            double cc = 0;
            double dd = 0;

            Cursor.Current = Cursors.WaitCursor;

            aa = ItemIndex;
            tChart1.Series[ItemIndex].Active = true;
            tChart1.Axes.Left.AutomaticMaximum = false;
            ....
      }
...
}
Can you assist?
Thanks!

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: Static hosting routine causes Object Reference error

Post by Sandra » Fri Nov 22, 2013 3:15 pm

Hello triby,

I would be very grateful, If you can send us a simple project where the exception appears, because we try to investigate because error is produced.

Thanks,
Best Regards,
Sandra Pazos / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply