title: Argument passing in C# and VB.NET
body: <p>In VB.NET, can we pass an original object as an argument without instantiating it? For example, I have two forms in my project formA and formB. Now I have this code.</p>
  
  <pre><code>Public Sub AddForm(Form Outer, Form Inner)
      Inner.FormBorderStyle = FormBorderStyle.None
      Inner.TopLevel = False;
      Inner.Dock = DockStyle.Fill
      Inner.WindowState = FormWindowState.Normal
      Outer.Controls.Add(Inner)
      Inner.BringToFront()
      Inner.Show()
  End Sub
  </code></pre>
  
  <p>Now I can use this in any event like:</p>
  
  <pre><code>AddForm(formA, formB)
  </code></pre>
  
  <p>but ...</p>
  
  <p>Taking the same code in C#</p>
  
  <pre><code>public static void AddForm(Form Outer, Form Inner)
  {
      Inner.FormBorderStyle = FormBorderStyle.None;
      Inner.TopLevel = false;
      Inner.Dock = DockStyle.Fill;
      Inner.WindowState = FormWindowState.Normal;
      Outer.Controls.Add(Inner);
      Inner.BringToFront();
      Inner.Show();
  } 
  </code></pre>
  
  <p>I cannot call it like:</p>
  
  <pre><code>AddForm(formA, formB);
  </code></pre>
  
  <p>It gives the error </p>
  
  <blockquote>
    <p>formB is type but is used like a variable.</p>
  </blockquote>
  
  <p>Instead, I have to call it like:</p>
  
  <pre><code>AddForm(A, new B());
  </code></pre>
  
  <p>Apart from this, in VB.NET in any class like formA, if I type formA, I can see all the objects and controls present there but not in C#. Again, I have to make a new instance to see all the controls. This becomes a problem if I want to manipulate two running and working instances with each other. So what basic thing am I missing here?</p>
  
  <p>(I am an amateur programmer migrating from VB.NET to C#. Things are going nice and clean expect for the ones I've recently figured out.)</p>