简体   繁体   中英

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. 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. 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. So you can't change it in 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.

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?

Be successful

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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