views:

1928

answers:

3

I would like to be able to create a black custom window (with border and controls) like that shipped as part of expression blend, Twirl, or Adobe Lightroom.

Is there a best practices way of creating an owner drawn window?

Platform: C# and WindowsForms (any version)

+1  A: 

If the custom-chrome tools don't provide you with the look-and-feel that you want, this kind of thing is easy to do yourself in C#. Basically, you create a borderless form (FormBorderStyle = None) and then create all the controls and borders yourself, by placing controls where you need them (a label for the title bar, command buttons for close and minimize etc.) and/or drawing directly on the form's surface using the Graphics object.

You also have to implement code to allow the form to be dragged around by its "fake" title bar (see this answer for a sample of how to do this). You may also have to implement your own resizing mechanism (if you need the forms to be resizable).

Finally, although the custom-form code might be a bit clunky, you can implement it on a single form and then have all the other forms in your application inherit from this form, which makes it a very useful technique for custom-skinning an entire application.

MusiGenesis
A: 

can the form background be made transparent?

conrad