There's been some internal discussion about transparent and/or non-rectangular windows recently, and Nick Kramer recently addressed the issue in a blog post. Although I haven't had time to build a new solution that works with Avalon, I do have some older code that I've used to create layered windows in the past. Feel free to download the C# AlphaWindow solution for Visual Studio 2005 (the code originated in Visual Studio 2003). I don't know if this is the absolute best way to accomplish this, but it's worked for me in practice.
Basically, you have to provide a 32-bit image that includes an alpha channel (PNG). In the case of this example, the image is included as an embedded resource in the Visual Studio project. A quick look at the code should get you going. Notice that you can drag the window by clicking on any portion of the image that isn't completely transparent, including the drop shadow.
These windows work great for application splash screens where you display the window, do some start-up work, and hide it when you're done. You can also easily imagine Konfabulator-like functionality. I'd love to see someone adapt this to an Avalon sample. If you do this, share it with the rest of us in the Channel 9 Sandbox. Good luck!
Michael, I was not able to host controls on this window. Controls do not show up. Any idea why?
i want this sample but in visual basic .net 2005 not in c# can u help me
Is there any way to put controls on the form??
Hello. I'am very interested in this.
You don't put controls on these forms. You stack them under a main transparent form.
Most of what I've seen is a mechanism where you use 2 forms:
form 1: your layered window (under your main, borderless, window)
form 2: your borderless form with your controls, and with a TransparencyKey set where ever you need it to show through.
Take a look at how the Menu from WinXP are built with Spy++...... blows my mind that Microsoft put such a crappy design into production.... The context menu uses 3 windows: main one on which the menu items are, one to the right for the drop shadow, and one to the bottom for the drop shadow...
Get the idea?
Hope this helps.