예제 #1
0
        /// <summary>
        /// Show a Dialog in a form with a multi-line textbox for the message
        /// Returns : DialogResult.OK if "OK" pressed, DialogResult.Cancel if "Cancel" pressed, eventually DialogResult.Yes if "option" is clicked
        /// </summary>
        /// <param name="Message"></param>
        /// <param name="Caption"></param>
        /// <param name="ShowButtons"></param>
        /// <param name="OptionText"></param>
        /// <returns>DialogResult.OK if "OK" pressed, DialogResult.Cancel if "Cancel" pressed, eventually DialogResult.Yes if "option" is clicked</returns>
        public static DialogResult ShowDialog(string Message, string Caption, bool ShowButtons, string OptionText)
        {
            LongMessageForm form = new LongMessageForm();

            form.Text    = Caption;
            form.Message = Message;
            form.TopMost = true;

            form.ShowButtons = ShowButtons;
            form.OptionText  = OptionText;

            return(form.ShowDialog());
        }
예제 #2
0
        public static DialogResult ShowMessage(string Message, string Caption, bool modal)
        {
            LongMessageForm form = new LongMessageForm();

            form.Text    = Caption;
            form.Message = Message;
            form.TopMost = true;

            form.SetDesiredStartLocation(Cursor.Position.X, Cursor.Position.Y);

            if (modal)
            {
                return(form.ShowDialog());
            }

            form.Show();

            return(DialogResult.None);
        }