gpt4 book ai didi

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

转载 作者:太空狗 更新时间:2023-10-29 20:37:52 24 4
gpt4 key购买 nike

一段时间以来,我一直在尝试在我的 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 allowsapplications control over the outerframe of the window so that WPFcontent can be drawn over the titlebar. This allows applications tointegrate with Aero glass to emulatethe Office 2007/2010 look and feel, orto completely replace the frame withits own content without having tomanage all the system behaviors thatget lost when using WindowStyle.None"

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

24 4 0