title: How to pass a WinForm to Lua (LuaInterface)?
body: <p>I want to pass a WinForm object to Lua, my code:</p>
  <p>//Form1.cs</p>
  <pre><code>class Form1
  {
    private System.Windows.Forms.TextBox textBox1;
    private System.Windows.Forms.Button button1;
  
    private void button1_Click(object sender, EventArgs e)
    {
      Lua m_lua = new Lua();
      m_lua.DoFile(&quot;plugin.lua&quot;);
      object[] objs = m_lua.GetFunction(&quot;OnLoad&quot;).Call(this, this.textBox1);
      m_lua.Close();
    }
  }
  </code></pre>
  <p>--plugin.lua</p>
  <pre><code>function OnLoad(form, textbox)
    textbox.Text = form.button1.Text  --&gt;Nil
    textbox.Text = form.button1       --&gt;Expect an object, but got a string!
  end
  </code></pre>