private void BtnClose_Click(object sender, EventArgs e) { try { ws2300.close(); this.toolStripStatusLabel.Text = "COM closed"; } catch (Exception) { this.toolStripStatusLabel.Text = "COM never opened"; } }