예제 #1
0
        /// <summary>
        /// Confirms the specified title.
        /// </summary>
        /// <param name="title">The title.</param>
        /// <param name="message">The message.</param>
        /// <param name="text">The text.</param>
        /// <returns></returns>
        public static bool Confirm(string title, string message, MessageBoxText text)
        {
            WrappedMessageBox msg = new WrappedMessageBox();

            msg.Text    = title;
            msg.Message = message;
            if (text == MessageBoxText.YesNo)
            {
                msg.button1.Text = "Yes";
                msg.button2.Text = "No";
            }
            else
            {
                msg.button1.Text = "OK";
                msg.button2.Text = "Cancel";
            }
            msg.button1.Click += delegate
            {
                msg.DialogResult = DialogResult.OK;
            };
            msg.button2.Click += delegate
            {
                msg.DialogResult = DialogResult.Cancel;
            };
            return(msg.ShowDialog() == DialogResult.OK);
        }
예제 #2
0
 /// <summary>
 /// Shows the message.
 /// </summary>
 /// <param name="title">The title.</param>
 /// <param name="message">The message.</param>
 public static void ShowMessage(string title, string message)
 {
     WrappedMessageBox msg = new WrappedMessageBox();
     msg.Text = title;
     msg.Message = message;
     msg.button1.Visible = false;
     msg.button2.Text = "OK";
     msg.button2.Click += delegate
     {
         msg.DialogResult = DialogResult.OK;
     };
     msg.ShowDialog();
 }
예제 #3
0
        /// <summary>
        /// Shows the message.
        /// </summary>
        /// <param name="title">The title.</param>
        /// <param name="message">The message.</param>
        public static void ShowMessage(string title, string message)
        {
            WrappedMessageBox msg = new WrappedMessageBox();

            msg.Text            = title;
            msg.Message         = message;
            msg.button1.Visible = false;
            msg.button2.Text    = "OK";
            msg.button2.Click  += delegate
            {
                msg.DialogResult = DialogResult.OK;
            };
            msg.ShowDialog();
        }
예제 #4
0
 /// <summary>
 /// Confirms the specified title.
 /// </summary>
 /// <param name="title">The title.</param>
 /// <param name="message">The message.</param>
 /// <param name="text">The text.</param>
 /// <returns></returns>
 public static bool Confirm(string title, string message, MessageBoxText text)
 {
     WrappedMessageBox msg = new WrappedMessageBox();
     msg.Text = title;
     msg.Message = message;
     if (text == MessageBoxText.YesNo)
     {
         msg.button1.Text = "Yes";
         msg.button2.Text = "No";
     }
     else
     {
         msg.button1.Text = "OK";
         msg.button2.Text = "Cancel";
     }
     msg.button1.Click += delegate
     {
         msg.DialogResult = DialogResult.OK;
     };
     msg.button2.Click += delegate
     {
         msg.DialogResult = DialogResult.Cancel;
     };
     return msg.ShowDialog() == DialogResult.OK;
 }