private void closeButton_Click(object sender, EventArgs e) { long lResult = LKPrint.ClosePort(); if (lResult != 0) { MessageBox.Show("Close Port Failed", "Error", MessageBoxButtons.OK); } else { int sIndex = portNameCBox.SelectedIndex; if (sIndex > 8) { baudRateCBox.Enabled = false; } else { baudRateCBox.Enabled = true; portNameCBox.Enabled = true; openButton.Enabled = true; closeButton.Enabled = false; printSampleButton.Enabled = false; } } }
private void exitButton_Click(object sender, EventArgs e) { LKPrint.ClosePort(); this.Close(); }