c# - 如何在窗口标题栏顶部显示菜单

标签 c# wpf

一段时间以来,我一直在尝试在我的 WPF 标题栏(左上角的橙色菜单)上显示这样的菜单:

https://wiki.mozilla.org/Firefox/4.0_Windows_Theme%20_Mockups#Large_Button_Mode

我已使用 DwmExtendFrameIntoClientArea 方法将毛玻璃扩展到客户区。 左上角的应用程序图标不可见,我可以显示菜单,但是无法单击它,它不会打开,如果我在标题栏中放置一个文本框,我无法编辑它内容。 我认为我的控件不在标题栏的顶部。如何将它们绘制在标题栏的顶部,以便菜单可以点击?

最佳答案

WPF Shell 集成库可能会帮助您实现这一点:

http://code.msdn.microsoft.com/WPFShell (通过 http://blogs.msdn.com/b/llobo/archive/2010/05/10/wpf-shell-integration-library.aspx )

"The custom chrome feature allows applications control over the outer frame of the window so that WPF content can be drawn over the title bar. This allows applications to integrate with Aero glass to emulate the Office 2007/2010 look and feel, or to completely replace the frame with its own content without having to manage all the system behaviors that get lost when using WindowStyle.None"

关于c# - 如何在窗口标题栏顶部显示菜单,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3131500/

相关文章:

c# - 软件包需要 NuGet 客户端版本...或更高版本

c# - WCF,ServiceHost - CreateChannel,不创建新的远程实例

c# - 将 UI 操作委托(delegate)给 ViewModel 执行

c# - 网格下拉列表中的列表不返回值

c# - 为什么 wpf 复选框绑定(bind)可能无法工作?

c# - 如何在整个 Windows 操作系统中更改光标(图像)

c# - 使用 AM/PM 将 6 位数字转换为时间

wpf - TreeView.ItemTemplate HierarchicalDataTemplate 中的数据在切换 Selected TreeItem 时被删除

c# - 使选项卡标题灵活地适应 WPF 上的标题文本

c# - 在 ASP.NET C# 中反序列化 JSON