コード例 #1
0
 private static DialogResult Show(ThreeOptionConfirmBox cb)
 {
     if (cb.ParentWindow != null)
     {
         cb.Left = cb.ParentWindow.Left + (cb.ParentWindow.Width - cb.Width) / 2;
         cb.Top  = cb.ParentWindow.Top + (cb.ParentWindow.Height - cb.Height) / 2;
     }
     else
     {
         cb.StartPosition = FormStartPosition.CenterScreen;
     }
     return(cb.ShowDialog());
 }
コード例 #2
0
        public static DialogResult Show(Form parent, string title, string message, int interval, Decide defaultChoose)
        {
            var cb = new ThreeOptionConfirmBox(title, message, interval, defaultChoose)
            {
                ParentWindow = parent
            };

            if (interval == Timeout.Infinite)
            {
                cb.PinMessage();
            }
            else
            {
                cb.UnpinMessage();
            }
            return(Show(cb));
        }