コード例 #1
0
ファイル: MessageForm.cs プロジェクト: uvbs/test-code-backup
        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();
            }
        }
コード例 #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();
            }
        }
コード例 #3
0
ファイル: MessageForm.cs プロジェクト: uvbs/test-code-backup
        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();
        }
コード例 #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();
     }
 }
コード例 #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();
 }
コード例 #6
0
ファイル: MessageForm.cs プロジェクト: Nicologies/QTTabBar
 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();
     }
 }