This should do it:
DialogResult dialogResult = MessageBox.Show("Sure", "Some Title", MessageBoxButtons.YesNo);
if(dialogResult == DialogResult.Yes)
{
//do something
}
else if (dialogResult == DialogResult.No)
{
//do something else
}
More Related Contents:
- Using DialogResult Correctly
- CMD command on c#
- C#, Winform: How to pass information from one form to another [duplicate]
- Creating a DPI-Aware Application
- DPI Awareness – Unaware in one Release, System Aware in the Other [duplicate]
- How can I run another application within a panel of my C# program?
- Showing a Windows form on a secondary monitor?
- How to stop BackgroundWorker correctly
- How do I automatically scroll to the bottom of a multiline text box?
- Double Buffering when not drawing in OnPaint(): why doesn’t it work?
- How to color different words with different colors in a RichTextBox while a user is writing and raise an event when that colored text is clicked
- How to share data between forms?
- Colour Individual Items in a winforms ComboBox?
- Is the size of a Form in Visual Studio designer limited to screen resolution?
- A textbox/richtextbox that has syntax highlighting? [C#] [closed]
- Detect Windows font size (100%, 125%, and 150%)
- How to draw a rounded rectangle in c#
- How to create a C# Winforms Control that hovers
- How do I implement a progress bar in C#?
- C# Windows Forms Application – Updating GUI from another thread AND class?
- UserControl with header and content – Allow dropping controls in content panel and Prevent dropping controls in header at design time
- Add vertical scroll bar to panel
- ClickOnceInstall CefSharp Winforms Problems
- How to eliminate flicker in Windows.Forms custom control when scrolling?
- Change language at runtime in C# winform
- ComboBox placeholder text (hint, cue banner, default text)
- Winforms : How to bind the Checkbox item of a CheckedListBox with databinding
- semi-transparent form but opaque Controls in C#
- Passing object to different windows forms
- Prevent users from resizing the window/form size