private void ec_OnGetChkCode(object sender, Image i) { if (InvokeRequired) { Invoke(new EtermConnection.ChkCodeHandler(ec_OnGetChkCode), sender, i); return; } frmRegistor frmregisto = new frmRegistor(ec, i); frmregisto.StartPosition = FormStartPosition.CenterScreen; frmregisto.ShowDialog(); frmregisto.Dispose(); }