views:

22

answers:

1

I see that many applications do not have a title bar, but still have the window controls in the upper right corner. These are also styled differently than the normal windows form controls. Is it possible to achieve this effect in WPF?

Here are some examples:

Zune Desktop software: http://i548.photobucket.com/albums/ii356/elpedrogrande/btns2.gif

Photoshop: http://i548.photobucket.com/albums/ii356/elpedrogrande/btns3.gif

GoTo Assist: http://i548.photobucket.com/albums/ii356/elpedrogrande/btns1.gif

A: 

They do this by setting the window style bits so it is created without a title bar. And then draw their own, making it look like a custom one. Which is the main reason that all these programs have caption glyphs that are not identical.

You'd accomplish the same in WPF by setting the WindowStyle to None. And a whole bunch of code to get back the behavior that Windows implements automatically with the title bar. Google "WM_NCHITTEST" to find out more.

Hans Passant