Exemplo n.º 1
0
        public static DialogResult Show(Form parent, string title, string message, int intervalInMilliseconds)
        {
            var wb = new WarningBox(title, message, intervalInMilliseconds)
            {
                ParentWindow = parent
            };

            if (intervalInMilliseconds != Timeout.Infinite)
            {
                wb.UnpinMessage();
            }
            return(Show(wb));
        }
Exemplo n.º 2
0
 private static DialogResult Show(WarningBox wb)
 {
     if (wb.ParentWindow != null)
     {
         wb.Left = wb.ParentWindow.Left + (wb.ParentWindow.Width - wb.Width) / 2;
         wb.Top  = wb.ParentWindow.Top + (wb.ParentWindow.Height - wb.Height) / 2;
     }
     else
     {
         wb.StartPosition = FormStartPosition.CenterScreen;
     }
     return(wb.ShowDialog());
 }