Confirmation box in c# windows application

To make a confirmation box in c# windows application we can use

MessageBox.Show(string text,string caption,MessageBoxButtons buttons)

Coding :

if (MessageBox.Show(”Do you want to delete?”, “Confirm delete”,MessageBoxButtons.YesNo) == DialogResult.Yes)
{
MessageBox.Show(”Deleted”);
}

In the above coding when a button delete is clicked a condition is checked and confirmation box “Do you want to delete” is arised with two buttons ‘Yes’ and ‘No’.If ‘Yes’ is clicked then another message box “Deleted” is showed.

Popularity: 14% [?]

Related posts:

  1. How to open an application, file Using Shell execute in .net
  2. Creating Excel as Datasource for Mail Merge using C#
You can leave a response, or trackback from your own site.

Leave a Reply

Designed by: Business Web Hosting | Thanks to Buy Icons, travel tips and Used Cars