Click here to Skip to main content
15,886,362 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi all,

Can anyone please tell me how to create our own window title bar?
Posted
Updated 6-Jul-11 21:21pm
v2
Comments
Dalek Dave 7-Jul-11 3:21am    
Edited for Clarity.

I've done it, it's as trivial as it is obvious. Dock something to the top of the form. Put minimise/maximise/close buttons on it. When someone clicks on the bar in general, capture the mouse and move the form with the mouse until the button is lifted. Which bit is hard for you ?
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 7-Jul-11 3:11am    
This not true non-client programming, but why doing it in WPF? Quite a reasonable idea. My 5.

I added just one more recommendation in my answer, which is not quite obvious for some.
--SA
In addition to the suggestion by Cristian: for such window, use WindowStyle="None".

—SA
 
Share this answer
 
Comments
Tarun.K.S 7-Jul-11 4:11am    
Exactly, and create a maybe a stackapanel with some buttons representing minimize, maximize and close functions. 5+
Sergey Alexandrovich Kryukov 7-Jul-11 4:45am    
Thank you, Tarun.
Yes, it's like two StackPanels (one left and right), or may be better on DockPanel.
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900