Example #1
0
        /// <summary>
        /// Shows a message dialog (without a question) with a 'don't ask again' checkbox
        /// </summary>
        /// <param name="text">The text to display</param>
        /// <param name="caption">The window title</param>
        /// <param name="icon">The icon to display</param>
        /// <returns>Whether to show this again</returns>
        private bool showMessage(string text, string caption, MessageBoxIcon icon)
        {
            MessageBoxEx msgBox = createMessageBox(text, caption, icon);

            msgBox.AddButtons(MessageBoxButtons.OK);
            msgBox.Show();
            return(!msgBox.SaveResponseChecked);
        }
Example #2
0
        public static string ShowErrorOld(string text, MessageBoxButtons buttons)
        {
            MessageBoxEx messageBox = MessageBoxExManager.CreateMessageBox(null);

            messageBox.Text    = text;
            messageBox.Caption = "Error";
            messageBox.AddButtons(MessageBoxButtons.OK);
            messageBox.Icon = MessageBoxExIcon.Error;
            return(messageBox.Show());
        }
        public void Test5()
        {
            MessageBoxEx msgBox = MessageBoxExManager.CreateMessageBox(null);

            msgBox.Caption = "Question";
            msgBox.Text    = "Voulez-vous sauver les données ?";
            msgBox.AddButtons(MessageBoxButtons.YesNoCancel);
            msgBox.Icon = MessageBoxExIcon.Question;

            msgBox.Show();
        }
        public void Test6()
        {
            MessageBoxEx msgBox = MessageBoxExManager.CreateMessageBox("test");

            msgBox.Caption = "Information";
            msgBox.AddButtons(MessageBoxButtons.OK);

            msgBox.Text = "The following items are defined:\nItem 1\nItem 2\nItem 3\nItem 4\nItem 5\nItem 6\nItem 7\nItem 8\nItem 9\nItem10\n";
            msgBox.Show();

            msgBox.Text = "Items:\nItem 1\nItem 2\nItem 3\nItem 4\nItem 5\nItem 6\nItem 7\nItem 8\nItem 9\nItem10\n";
            msgBox.Show();
        }
        private void Test()
        {
            MessageBoxEx msgBox = MessageBoxExManager.CreateMessageBox("Test");

            msgBox.Caption = "Question";
            msgBox.Text    = "Do you want to save the data?";

            msgBox.AddButtons(MessageBoxButtons.YesNo);
            msgBox.Icon = MessageBoxExIcon.Question;

            msgBox.SaveResponseText  = "Don't ask me again";
            msgBox.AllowSaveResponse = true;

            msgBox.Font = new Font("Tahoma", 8);

            string result = msgBox.Show();
        }
        private void Test4()
        {
            MessageBoxEx msgBox = MessageBoxExManager.CreateMessageBox(null);

            msgBox.Caption = "Question";
            msgBox.Text    = "Do you want to save the data?";

            msgBox.AddButtons(MessageBoxButtons.YesNo);
            msgBox.Icon = MessageBoxExIcon.Question;

            //Wait for 30 seconds for the user to respond
            msgBox.Timeout       = 30000;
            msgBox.TimeoutResult = TimeoutResult.Timeout;

            string result = msgBox.Show();

            if (result == MessageBoxExResult.Timeout)
            {
                //Take action to handle the case of timeouts
            }
        }