Delegate to other thread with parameters in C#
===

How can you delegate a function with parameters to an other thread in C#?

If I try it on my own I get this error:

    error CS0149: Method name expected

This is what I have now:

    delegate void BarUpdateDelegate();
        private void UpdateBar(int Value,int Maximum,ProgressBar Bar)
        {
            if (Bar.InvokeRequired)
            {
                BarUpdateDelegate Delegation = new BarUpdateDelegate(Value, Maximum, Bar); //error CS0149: Method name expected
                Bar.Invoke(Delegation);
                return;
            }
            else
            {
                Bar.Maximum = Maximum;
                Bar.Value = Value;
    
                //Insert the percentage
                int Percent = (int)(((double)Value / (double)Bar.Maximum) * 100);
                Bar.CreateGraphics().DrawString(Percent.ToString() + "%", new Font("Arial", (float)8.25, FontStyle.Regular), Brushes.Black, new PointF(Bar.Width / 2 - 10, Bar.Height / 2 - 7));
    
                return;
            }
        }

I want to update from an other thread the progress bar in the main thread.