Ejemplo n.º 1
0
        public static void Show(IntPtr hwndParent, string strMessage, string strTitle, MessageBoxIcon icon, int msecDuration, bool fModal = false)
        {
            MessageForm form = new MessageForm(strMessage, strTitle, null, icon, msecDuration);

            if (hwndParent != IntPtr.Zero)
            {
                RECT rect;
                PInvoke.GetWindowRect(hwndParent, out rect);
                form.Location = new Point(rect.left + ((rect.Width - form.Width) / 2), rect.top + ((rect.Height - form.Height) / 2));
            }
            else
            {
                Rectangle workingArea = Screen.PrimaryScreen.WorkingArea;
                form.Location = new Point((workingArea.X + workingArea.Width) - form.Width, (workingArea.Y + workingArea.Height) - form.Height);
            }
            if (fModal)
            {
                form.TopMost = true;
                form.ShowDialog();
            }
            else
            {
                form.ShowMessageForm();
            }
        }
Ejemplo n.º 2
0
        public static void Show(IntPtr hwndParent, string strMessage, string strTitle, MessageBoxIcon icon, int msecDuration, bool fModal = false, bool fTopMost = false)
        {
            MessageForm form = new MessageForm(strMessage, strTitle, null, icon, msecDuration);
            Rectangle   parentRect;

            if (hwndParent != IntPtr.Zero)
            {
                RECT rect;
                PInvoke.GetWindowRect(hwndParent, out rect);
                parentRect = rect.ToRectangle();
            }
            else
            {
                parentRect = Screen.PrimaryScreen.WorkingArea;
            }
            form.Location = new Point(parentRect.Left + ((parentRect.Width - form.Width) / 2),
                                      parentRect.Top + ((parentRect.Height - form.Height) / 2));
            if (fModal)
            {
                form.TopMost = true;
                form.ShowDialog();
            }
            else
            {
                form.TopMost = fTopMost;
                form.ShowMessageForm();
            }
        }
Ejemplo n.º 3
0
        public static void Show(string strMessage, string strTitle, string strExecute, MessageBoxIcon icon, int msecDuration)
        {
            MessageForm form        = new MessageForm(strMessage, strTitle, strExecute, icon, msecDuration);
            Rectangle   workingArea = Screen.PrimaryScreen.WorkingArea;

            form.Location = new Point((workingArea.X + workingArea.Width) - form.Width, (workingArea.Y + workingArea.Height) - form.Height);
            form.ShowMessageForm();
        }
Ejemplo n.º 4
0
 public static void Show(IntPtr hwndParent, string strMessage, string strTitle, MessageBoxIcon icon, int msecDuration, bool fModal = false) {
     MessageForm form = new MessageForm(strMessage, strTitle, null, icon, msecDuration);
     if(hwndParent != IntPtr.Zero) {
         RECT rect;
         PInvoke.GetWindowRect(hwndParent, out rect);
         form.Location = new Point(rect.left + ((rect.Width - form.Width) / 2), rect.top + ((rect.Height - form.Height) / 2));
     }
     else {
         Rectangle workingArea = Screen.PrimaryScreen.WorkingArea;
         form.Location = new Point((workingArea.X + workingArea.Width) - form.Width, (workingArea.Y + workingArea.Height) - form.Height);
     }
     if(fModal) {
         form.TopMost = true;
         form.ShowDialog();
     }
     else {
         form.ShowMessageForm();
     }
 }
Ejemplo n.º 5
0
 public static void Show(string strMessage, string strTitle, string strExecute, MessageBoxIcon icon, int msecDuration) {
     MessageForm form = new MessageForm(strMessage, strTitle, strExecute, icon, msecDuration);
     Rectangle workingArea = Screen.PrimaryScreen.WorkingArea;
     form.Location = new Point((workingArea.X + workingArea.Width) - form.Width, (workingArea.Y + workingArea.Height) - form.Height);
     form.ShowMessageForm();
 }
Ejemplo n.º 6
0
 public static void Show(IntPtr hwndParent, string strMessage, string strTitle, MessageBoxIcon icon, int msecDuration, bool fModal = false, bool fTopMost = false)
 {
     MessageForm form = new MessageForm(strMessage, strTitle, null, icon, msecDuration);
     Rectangle parentRect;
     if(hwndParent != IntPtr.Zero) {
         RECT rect;
         PInvoke.GetWindowRect(hwndParent, out rect);
         parentRect = rect.ToRectangle();
     }
     else {
         parentRect = Screen.PrimaryScreen.WorkingArea;
     }
     form.Location = new Point(parentRect.Left + ((parentRect.Width - form.Width) / 2),
             parentRect.Top + ((parentRect.Height - form.Height) / 2));
     if(fModal) {
         form.TopMost = true;
         form.ShowDialog();
     }
     else {
         form.TopMost = fTopMost;
         form.ShowMessageForm();
     }
 }