private void cmdExport_Click(object sender, EventArgs e) { if ((BaseForm)this.ActiveMdiChild == null) { MessageBox.Show("必须先激活一个模块窗口!", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } try { int nModelID = ((BaseForm)this.ActiveMdiChild).ModID; TabExport frm = new TabExport(nModelID, conn); frm.ShowDialog(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }