private void BtnRestartDevice_Click(object sender, EventArgs e) { DialogResult rslt = MessageBox.Show("Do you wish to restart the device now ??", "Restart Device", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (rslt == DialogResult.Yes) { if (objZkeeper.RestartDevice(int.Parse(tbxMachineNumber.Text.Trim()))) { ShowStatusBar("The device is being restarted, Please wait...", true); } else { ShowStatusBar("Operation failed,please try again", false); } } }