Example #1
0
        public static DialogBoxResult Show(IWin32Window owner, string text, string caption = "", DialogButton[] buttons = null, DialogBoxIcon icon = DialogBoxIcon.None, string title = null, int defaultButton = 1, int timeOut = 0, DialogBoxTimeoutResult timeoutResult = DialogBoxTimeoutResult.Timeout, int disable = 0)
        {
            DialogBoxForm dg = new DialogBoxForm()
            {
                Title         = title,
                Message       = text,
                Caption       = caption,
                Image         = icon,
                DefaultButton = defaultButton,
                Timeout       = timeOut,
                TimeoutResult = timeoutResult,
                Disable       = disable,
            };

            if (buttons == null)
            {
                buttons = new DialogButton[] { new DialogButton("Ok", DialogBoxResult.Ok) }
            }
            ;

            foreach (DialogButton btn in buttons)
            {
                dg.AddButton(btn.Text, btn.Result);
            }

            return(dg.ShowDialog(owner));
        }
Example #2
0
        public static DialogBoxResult Show(IWin32Window owner, string text, string caption = "", DialogBoxButtons buttons = DialogBoxButtons.Ok, DialogBoxIcon icon = DialogBoxIcon.None, string title = null, int defaultButton = 1, int timeOut = 0, DialogBoxTimeoutResult timeoutResult = DialogBoxTimeoutResult.Timeout, int disable = 0)
        {
            DialogBoxForm dg = new DialogBoxForm()
            {
                Title         = title,
                Message       = text,
                Caption       = caption,
                Image         = icon,
                DefaultButton = defaultButton,
                Timeout       = timeOut,
                TimeoutResult = timeoutResult,
                Disable       = disable,
            };

            dg.AddButtons(buttons);

            return(dg.ShowDialog(owner));
        }