title: How do I communicate with a control of a Form from another class?
body: <p>A little new to C#, and approaching something beyond me. Apologies for length.</p>
  
  <p>I have a Windows Form application in Visual Studio C# Express, using the default classes VS spawns. I want to start and stop a Marquee style progressBar from a class other than the default Form1 in which it is declared. 
  These seems surprisingly difficult, I am sure I am missing something important.</p>
  
  <p>My project has the usual classes that Visual Studio auto generates: 
  <em>Form1.cs, Form1.Designer.cs , Program.cs .</em>
  I added  <em>myClass.cs</em> that wants to talk the load bar.
  I add <em>progressBar1</em> bar to my form using the designer, setting Style:Marquee.</p>
  
  <p>In <em>Form1.cs</em>' Form() constructor, I write</p>
  
  <pre><code>this.progressBar1.Visible = false;
  </code></pre>
  
  <p>This works. Intellisense 'sees' <em>progresBar1.</em>
  code in <em>Form1.cs</em> can see and control <em>progressBar1</em> declared in <em>Form1.Designer.cs</em>.
  this makes sense to me.</p>
  
  <p>But the functions which need to start and stop the load bar must live in <em>myClass.cs</em>.
  I want to be able to code like this, within <em>myClass.cs</em>:</p>
  
  <pre><code>public void myFunction(){
      Form1.progressBar1.visible=true
      //do stuff that takes a bit of time
      Form1.progressBar1.visible=false
  }
  </code></pre>
  
  <p>This does not work. Intellisense cannot 'see' <em>progresBar1</em> when typing code in <em>myClass.cs.</em>
  In fact, intellisense cannot 'see' anything in <em>Form1.cs</em> from within <em>myClass.cs.</em>
  No  public propeties or functions added to <em>Form1</em> ever become visible to intellisense.
  This does not make sense to me, I am confused. 
  This seems like something you would want to do often and easily.</p>
  
  <p>Some searching indicates that this blocking of external access to Form controls is by design. Something to do with 'decoupling' your logic code from GUI code, which makes sense in principal.So clearly there is an expected approach, yet an clear example is hard to find. I can only find examples of loadbars controlled from entirely within the Forms that declare them, or terse half-examples about creating and registering Events or using Invoke or other things I know too little about. There are many apparent solutions but none that I can see clearly apply to me, or that I am able to implement, in my ignorance.</p>
  
  <p>I think I could do it if my Form were an instance. 
  [EDIT] nope. instance or not, <em>Form1</em> controls never become exposed outside of <em>Form1.cs</em></p>
  
  <p>So, How do I to start and stop a Marquee style progressBar from a class other than the default <em>Form1</em> in which it is declared, in the proper way? 
  Is there a clear and useful example somewhere?</p>