|
Author: Jenny Nguyen
|
|
When writing application you will often come across a requirement to get confirmation from the user before going ahead to delete a record. This is a common practice for all the applications that has been built to confirm with the user before the application is closed or a record is deleted. C# has a nice set of built in libraries which does all this for you so you dont have to write any code. For a quick and simple cofirmation you can use the MessageBox library. private void btnDeleteFL_Click(object sender, EventArgs e) { if (MessageBox.Show("Are you sure you want to delete this feature?", "Confirm delete", MessageBoxButtons.YesNo) == DialogResult.Yes) { // Delete the require record according to the user command. } }
|
