屏幕右下角的显示形式?

时间:2013-02-13 21:25:21

标签: c# .net notifications taskbar

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

如何在屏幕右下方显示请求表单不在任务栏上方

enter image description here

代码:

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

任何帮助都将受到高度赞赏

2 个答案:

答案 0 :(得分:8)

试试这个:

        int x = Screen.PrimaryScreen.WorkingArea.Width - this.Width;
        int y = Screen.PrimaryScreen.WorkingArea.Height - this.Height;
        this.Location = new Point(x, y);

答案 1 :(得分:3)

如果您确实必须在特定地点收到通知,则需要使用

  

SystemParameters.WorkArea property

哪些

  

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

用于WPF应用程序。

  

Screen.WorkingArea property

得到

  

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

用于WinForms应用程序。

这也可以这样:

Rectangle workingRectangle = Screen.PrimaryScreen.WorkingArea;

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