private void button4_Click(object sender, EventArgs e) { if (comPortForm == null || comPortForm.IsDisposed) { comPortForm = new COMPortForm(serial); } if (!comPortForm.Visible) { comPortForm.Show(null); } else { comPortForm.Focus(); } }