0
我在定位窗口时遇到了问题。窗户不是我的主窗口。我想将窗口放置在任务栏上方工作区域的右下角。通知窗口在右下角的位置
我有下面的代码:
public partial class NotificationWindow : Window
{
public NotificationWindow()
{
InitializeComponent();
}
private void Window_Loaded(object sender, RoutedEventArgs e)
{
Rect desktopWorkingArea = SystemParameters.WorkArea;
Left = desktopWorkingArea.Right - Width;
Top = desktopWorkingArea.Bottom - Height;
}
}
及事与愿违的结果代码的:
我想有通知窗口在任务栏上方稍稍高出。 我认为我的代码应该可以工作,但事实并非如此。
感谢您的咨询。
添加偏移或找出任务栏的大小 - https://winsharp93.wordpress.com/2009/06/29/find-out-size-and-position-of-the-taskbar/ –