c# Accessing WinForm control properties from another class
<p>How does one access WinForm controls such as <code>ProgressBar</code> properties from another class? </p>

<p>Please see my code below.  I know this might not be the best option to expose WinForm class and its members as <code>public</code> but I am trying to clear the concept at this point.</p>

<pre><code>namespace WindowsFormsApplication1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        public void button1_Click(object sender, EventArgs e)
        {
            Class1 c = new Class1();
            c.loop();
        }

        public void PBSetup()
        {
            progressBar1.Minimum = 0;
            progressBar1.Maximum = 100;
        }

        public void PBUpdate(int recno)

        {
            progressBar1.Value = Class1.recno;
        }
    }
}

namespace WindowsFormsApplication1
{
    class Class1
    {

        public static int recno;

        public void loop()
        {
            //How do I access Form1.PBSetup()??

            for (recno = 0; recno &lt;= 100; recno++)
            {
                //How do I access Form1.PBUpdate(recno)??
            }
        }
    }
}
</code></pre>
