private void btnClose_Click(object sender, EventArgs e) { try { ControlBox = true; clsModbus mo = new clsModbus(); mo.ACloseSerialPort(); CloseForm(); } catch (Exception ae) { } }
private void btnCancel_Click(object sender, EventArgs e) { btnCancel.Visible = false; btnSearch.Visible = true; try { //ControlBox = true; clsModbus mo = new clsModbus(); mo.ACloseSerialPort(); CancelSearch(); } catch (Exception ae) { } }
private void btnSet_Click(object sender, EventArgs e) { this.DialogResult = DialogResult.OK; this.Close(); //Setting not set issue add close port function try { ControlBox = true; clsModbus mo = new clsModbus(); mo.ACloseSerialPort(); } catch (Exception ae) { } }