Maha

Maha

  • NA
  • 600
  • 71.4k

DialogResult

Oct 16 2014 7:47 AM
Following program is giving type status to DialogResult. I wish to know whether DialogResult is a type. Problem is highlighted.

using System;
using System.Windows.Forms;

public class HamburgerAddition
{
public static void Main()
{
string question = "Do you want fries with that?";
string caption = "Hamburger addition";
double price = 3.00;

DialogResult result = MessageBox.Show(question, caption, MessageBoxButtons.YesNo, MessageBoxIcon.Question);

if (result == DialogResult.Yes)
price += 0.75;

MessageBox.Show("Total is " + price.ToString("c"));
}
}


Answers (4)