title: Best practice for sharing variables across forms in VB.NET
body: <p>I need to share variables across two forms in VB.NET. One of them is the main form and the other is a child form.</p>
  
  <p>I have been searching, and I have found a few methods. I want to use the best method to do this. I have listed a few options below. Please comment on which one would be the best option:</p>
  
  <ol>
  <li><p>Create a static/shared variable in one of the forms and access it in the other forms via:</p>
  
  <pre><code>Form1 frm = new Form1(); // Creating object of parent to access shared variable
  frm.a = "abc"; // Passing value
  </code></pre></li>
  <li><p>Send an instance of the main form to the child form when creating the child form. The variables can then be accessed via a property function.</p></li>
  <li><p>Create global variables in a module. This seems like the easiest option, but I doubt it is the best option.</p></li>
  <li><p>I also read something about delegates and events, but I don't know how to implement this.</p></li>
  </ol>
  
  <p>If there is another method I haven't mentioned, please share it with me.</p>