1

我正在创建一个基于显示用户应该接受或拒绝的一些通知的应用程序

如何在屏幕右下角而不是任务栏上方显示申请表?

在此处输入图像描述

代码 :

notificationForm ntf = new notificationForm();
ntf.ShowDialog();

任何帮助将不胜感激

4

2 回答 2

9

试试这个:

        int x = Screen.PrimaryScreen.WorkingArea.Width - this.Width;
        int y = Screen.PrimaryScreen.WorkingArea.Height - this.Height;
        this.Location = new Point(x, y);
于 2013-02-13T21:34:57.170 回答
3

如果您确实必须将通知放在特定位置,那么您需要使用

SystemParameters.WorkArea 属性

哪一个

获取主显示监视器上工作区的大小。

对于 WPF 应用程序。

或者

Screen.WorkingArea 属性

得到

工作区域是显示器的桌面区域,不包括任务栏、停靠的窗口和停靠的工具栏。

对于 WinForms 应用程序。

这也可以像这样得到:

Rectangle workingRectangle = Screen.PrimaryScreen.WorkingArea;

根据这些信息,您将能够将您的窗口放置在您喜欢的任何位置。

于 2013-02-13T21:35:15.910 回答