Namespace: System.Windows.Forms MessageBox public static DialogResult Show( string text ) - только сам текст сообщения Например MessageBox.Show("Hello, world.");
Есть много перегрузок у метода Show Show(String, String) - текст и заголовок Show(String, String, MessageBoxButtons) - текст и заголовок и кнопки Show(String, String, MessageBoxButtons, MessageBoxIcon) - плюс иконка окна сообщения Show(String, String, MessageBoxButtons, MessageBoxIcon, MessageBoxDefaultButton) - плюс выбрана кнопка по умолчанию И еще и еще. Смотрите справку на сайте MSDN
Пример с иконкой MessageBox.Show("Typical installation is strongly recommended.", "Install information", MessageBoxButtons.OK, MessageBoxIcon.Information);
Using System; namespace Fractions{ public struct Fraction : IComparable<Fraction> { public Fraction(int numerator, int denominator) { Numerator = numerator; Denominator = denominator; } public int Numerator; public int Denominator; public int CompareTo(Fraction other) { return (Numerator * other.Denominator).CompareTo(other.Numerator * Denominator); } } public class Program { static void Main(string[] args) { int numerator, denominator; Console.Write("Числитель первой дроби "); numerator = int.Parse(Console.ReadLine()); Console.Write("Знаменатель первой дроби "); denominator = int.Parse(Console.ReadLine()); var fraction1 = new Fraction(numerator, denominator); Console.Write("Числитель второй дроби "); numerator = int.Parse(Console.ReadLine()); Console.Write("Знаменатель второй дроби "); denominator = int.Parse(Console.ReadLine()); var fraction2 = new Fraction(numerator, denominator); var compareResult = fraction1.CompareTo(fraction2); if (compareResult < 0) Console.WriteLine("<"); else if (compareResult > 0) Console.WriteLine(">"); else // = 0 Console.WriteLine("="); } }}
MessageBox
public static DialogResult Show( string text ) - только сам текст сообщения
Например
MessageBox.Show("Hello, world.");
Есть много перегрузок у метода Show
Show(String, String) - текст и заголовок
Show(String, String, MessageBoxButtons) - текст и заголовок и кнопки
Show(String, String, MessageBoxButtons, MessageBoxIcon) - плюс иконка окна сообщения
Show(String, String, MessageBoxButtons, MessageBoxIcon, MessageBoxDefaultButton) - плюс выбрана кнопка по умолчанию
И еще и еще. Смотрите справку на сайте MSDN
Пример с иконкой
MessageBox.Show("Typical installation is strongly recommended.", "Install information", MessageBoxButtons.OK, MessageBoxIcon.Information);