title: System.Windows.Forms.AxHost InvalidActiveXStateException vb.net
body: <p>When i was converting VB to VB.NET, i found the error <code>InvalidActiveXStateException</code>.
  My program ahs a main form and many sub forms, and while I am checking the sub forms, one of them has this error and can not open that form, but the other forms can be opened correctly.
  The code is the same. Why i can not open that form?</p>
  
  <p>I had been researched from internet and most of people said that :</p>
  
  <pre><code>((System.ComponentModel.ISupportInitialize)(this.ax)).BeginInit();
  
  this.Controls.Add(ax);
  
  ((System.ComponentModel.ISupportInitialize)(this.ax)).EndInit();
  </code></pre>
  
  <p>but it seem C# not VB.NET and i dont know when can i found the name of ax in my program.
  here is part of my program code.</p>
  
  <pre><code>Public Sub mnu_dceedc_enq_Click(ByVal eventSender As System.Object, ByVal eventArgs        As System.EventArgs) Handles mnu_dceedc_enq.Click
      If bolCheckSecurity("dcs_eedc_enq") Then
          Unload_frm()
          DCformfun = mnu_dceedc_enq.Name
          frmDCEEDC.Show()
      End If
  End Sub
  
  Private Sub chkfiltercase_CheckStateChanged(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles chkfiltercase.CheckStateChanged
      '20090401
      'fgdetail_Click
  
      Call ShowFolderDetail(fgdetail.get_TextMatrix(fgdetail.Row, 1), fgdetail.get_TextMatrix(fgdetail.Row, 2), CShort(txtbatchno.Text))
  End Sub
  </code></pre>
  
  <p>When I open a sub form, it will start from <code>nu_dceedc_enq_Click</code> and then go to <code>chkfiltercase_CheckStateChanged</code> but when ran into <code>Call ShowFolderDetail</code>, it auto returns back to <code>form.show()</code> and the exception occurs.</p>
  
  <p>Why does this error occur and how can I solve it?</p>
  
  <p><strong>Update after testing:</strong></p>
  
  <p>I tried commenting all the Sub <code>chkfiltercase_CheckStateChanged</code> and the form occur success and I am try to test whether it will occur others or not.</p>