简体   繁体   English

自定义标题栏的设计问题

[英]Design problems with Custom Titlebar

I created a custom titlebar in my WPF application (it's actually an user control), because I needed a DropDown and a Button in it. 我在WPF应用程序中创建了一个自定义标题栏(实际上是一个用户控件),因为我需要其中的一个DropDown和一个Button。 It works fine. 工作正常。
My titlebar will be used often, also by other people. 我的标题栏将经常被其他人使用。

But how can I design my titlebar like the normal titlebar of windows apps. 但是,如何像Windows应用程序的普通标题栏一样设计标题栏。 It should be lifted like the border. 它应该像边界一样被抬起。

Is it also possible to create a window of the titlebar? 是否还可以创建标题栏的窗口? The problem is you can't drag the window, but the implementation of this should be in my custom titlebar, not in the main window (where the titlebar is inserted). 问题是您不能拖动窗口,但是此实现应在我的自定义标题栏中,而不是在主窗口(插入标题栏的地方)中。 What is your idea ? 你有什么想法 ?

在此处输入图片说明

It is not very easy to customize things like title bar because they are drawn by GDI. 定制标题栏之类的东西并不容易,因为它们是由GDI绘制的。 So you can't change it in WPF. 因此,您不能在WPF中进行更改。 You could try to change your window, and then GDI will not render the Titlebar, and you could create your own to replace it. 您可以尝试更改窗口,然后GDI不会渲染标题栏,您可以创建自己的标题栏来替换它。

These are some helpful links : http://blogs.msdn.com/b/wpfsdk/archive/2008/09/08/custom-window-chrome-in-wpf.aspx http://www.dreamincode.net/forums/topic/121576-c%23-wpf-custom-title-bar-tutorial/ http://social.msdn.microsoft.com/Forums/vstudio/en-US/bb9d4b22-1507-49bf-be2c-b9e23bc82d76/button-in-title-bar?forum=wpf http://marlongrech.wordpress.com/2009/02/27/title-less-windows-in-wpf/ How can I style the border and title bar of a window in WPF? 这些是一些有用的链接: http : //blogs.msdn.com/b/wpfsdk/archive/2008/09/08/custom-window-chrome-in-wpf.aspx http://www.dreamincode.net/forums / topic / 121576-c%23-wpf-custom-title-bar-tutorial / http://social.msdn.microsoft.com/Forums/vstudio/en-US/bb9d4b22-1507-49bf-be2c-b9e23bc82d76/button -in-title-bar?forum = wpf http://marlongrech.wordpress.com/2009/02/27/title-less-windows-in-wpf/ 如何在WPF中设置窗口的边框和标题栏的样式?

Be successful 成功的

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM