private void btnCloseSerialModule1_Click(object sender, EventArgs e) { mf.CloseModule1Port(); if (mf.spModule1.IsOpen) { cboxModule1Port.Enabled = false; btnCloseSerialModule1.Enabled = true; btnOpenSerialModule1.Enabled = false; } else { cboxModule1Port.Enabled = true; btnCloseSerialModule1.Enabled = false; btnOpenSerialModule1.Enabled = true; } }