title: C# passing class variable to windows form
body: <p>I'm fairly new to programming so please excuse my lack of knowledge.
  What's the easiest way to pass a variable in a class to a form? I am wanting to send sScanNum string to form button. Right now i have the button launching a qr generator and wanting to auto populate the value for the qr code.</p>
  
  <pre><code>foreach (ViewSheet cs in collsheets)
  {
      //string jobcontnumb = cs.LookupParameter("JobControlNumber").ToString();
  
      string sHeetNum = cs.SheetNumber.ToString();
  
      foreach (AssemblyInstance ai in Spool)
      {
  
         string jobConNum = ai.LookupParameter("JobControlNumber").AsString();
         ////string sHeetNum = cs.SheetNumber.ToString();
         string sScanNum = "*" + (jobConNum) + "-" + (sHeetNum) + "*";
  
         TaskDialog.Show(sScanNum, sScanNum);
         break;
  
      }    
  }
  </code></pre>