---
title: "How to show Yes or No button in MessageBox using C#?"  
description: "How to show Yes or No button in MessageBox using C#?"  
author: "Anonymous User"  
published: 2013-10-07  
updated: 2013-10-08  
canonical: https://www.mindstick.com/forum/1637/how-to-show-yes-or-no-button-in-messagebox-using-c-sharp  
category: "c#"  
tags: ["c#"]  
reading_time: 1 minute  

---

# How to show Yes or No button in MessageBox using C#?

I am [beginner](https://www.mindstick.com/forum/23159/need-beginner-project-ideas) in C# [window](https://www.mindstick.com/forum/161285/how-does-the-window-console-object-work-in-javascript) [Application](https://www.mindstick.com/articles/12824/calculator-application-in-android) I am show a Messagebox using MessageBox.Show("Pass Any [String](https://www.mindstick.com/articles/1527/string-split-in-c-sharp)") this [code](https://yourviews.mindstick.com/view/85458/alan-turing-the-mastermind-behind-cracking-the-enigma-code-during-world-war-ii) of line only show a [message](https://www.mindstick.com/forum/12802/show-confirmation-message-yes-or-no-in-asp-dot-net) box with Ok [button](https://www.mindstick.com/articles/63/how-to-add-button-in-datagridview-in-csharp-dot-net) but I want to show [Yes](https://www.mindstick.com/forum/157763/how-to-return-yes-no-based-on-date-comparison-in-sql) or No button in Message box please anybody help for resolving this problem.

Thanx in [Advanced](https://www.mindstick.com/articles/12993/5-advanced-features-for-your-odoo-ecommerce-theme)!

## Replies

### Reply by Anonymous User

You can use below line of code for showing Yes or No button in a message box: -

```
MessageBox.Show("Pass
the message", MessageBoxButtons.YesNo,
MessageBoxIcon.Warning);
```


---

Original Source: https://www.mindstick.com/forum/1637/how-to-show-yes-or-no-button-in-messagebox-using-c-sharp

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
