1
Reply

how to use parametrized function as a thread?

Sandeep Dange

Sandeep Dange

14y
4.2k
0
Reply

    You can use class to hold your parameters..

    public class MyClass
    {
       private string  param;
       public MyClass (string  param)
       {
           this.param = param;
       }
       public void YourFunction()
       {
           // use param here
       }
    }            

    MyClass cObj = new MyClass (param);
    Thread t=new Thread (new ThreadStart (cObj. YourFunction)).Start();                                  

     you can also use msdn reference, good example here.
    http://msdn.microsoft.com/en-us/library/1h2f2459(v=VS.90).aspx