0

I am trying to create a method that uses parameters to create a functionality of a splashScreen, i've done this by using nested methods and then using a method to use the previously made methods as a bigger method. It keeps throwing the same error and i'm not sure why, can anyone help please?

Heres the nested methods:

public class methods
{
    public class splash
    {
        Thread t { get; set; }
        public void start()
        {
            Application.Run(new Splash());
            Thread t = new Thread(new ThreadStart(start));
            t.Start();
        }

        public void action(int time)
        {
            Thread.Sleep(time);
        }

        public void stop()
        {
            t.Abort();
        }

        public void run(int time)
        {
            start();
            action(time);
            stop();
        }
    }

Here is where i'm trying to use it:

methods.splash.run(5000);

This is the error:

An object reference is required for the none-static field, method or property 'methods.splash.run(int)'

Soner Gönül
  • 97,193
  • 102
  • 206
  • 364
Harry
  • 13
  • 6

0 Answers0