【问题标题】:WPF NotifyIcon - ContextMenu PositionWPF NotifyIcon - ContextMenu 位置
【发布时间】:2012-06-09 19:20:52
【问题描述】:

我正在使用来自CodeProject 的 WPF NotifyIcon。它工作正常,但我注意到,当使用 .NET 4.0 编译时,ContextMenu 始终位于任务栏上方,使用 .NET 3.5 就可以了:

.NET 3.5

.NET 4.0

我在 TaskbarIcon 类中使用了位置值,但 ContextMenu 只是不想出现在任务栏前面:

    ContextMenu.Placement = PlacementMode.AbsolutePoint;
    ContextMenu.HorizontalOffset = cursorPosition.X;
    ContextMenu.VerticalOffset = cursorPosition.Y;

几周前我已经在comment section on CodePlex页面上询问过这个问题,但没有得到答复。

有人对此有解决方案或解决方法吗?

【问题讨论】:

  • 那是 CodeProject,而不是 CodePlex。 :)

标签: c# .net wpf contextmenu notifyicon


【解决方案1】:

我使用的是这个类来确定任务栏的位置,然后根据它放置上下文菜单而不是光标位置。

How can I determine programmatically whether the Windows taskbar is hidden or not?

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多