private void btnEraseAllData_Click(object sender, EventArgs e) { lblStatus.Visible = true; lblStatus.Text = "Erasing...Please wait"; lblStatus.Update(); string StrDevs = device35.hostport; if (device35.USBOpen(StrDevs) == false) { lblStatus.Visible = false; MessageBox.Show("Open USB fail"); lockButton(false); device35.Close(); return; } if (!device35.eraseSetting()) { lblStatus.Text = "Erase fail. Logger is recording"; rtxtEventLog.Text += "Erase fail. Logger is recording" + Environment.NewLine; device35.Close(); return; } else { lblStatus.Text = "..."; rtxtEventLog.Text += "Erase All Data Successfully" + Environment.NewLine; device35.Close(); btnReadSetting_Click(sender, e); cbbChannel_SelectedIndexChanged(sender, e); cbbUnit_SelectedIndexChanged(sender, e); return; } }