How can I give a Vista or Mac OS X style glass effects on windows forms applications in .net 2.0?
DevExpress components
- for .NET 2.0
http://devexpress.com/Products/NET/DXperience/editionWinForms.xml
Creating a Glass Button using GDI+
The glass window borders in Vista Aero are composited using the DWM. This is an OS-level feature. If you run your app on Vista, you should get the glass border for free.
If you want to extend the glass effect into the client area, use DwmExtendFrameIntoClientArea, which is how Internet Explorer does it in its toolbar. I suspect you'll have to write the interop to call this native function yourself (or check http://pinvoke.net).
This is done using interop with the Vista DWM (Desktop Window Manager) API.
For example, import these functions:
[DllImport("dwmapi.dll")]
static extern void DwmExtendFrameIntoClientArea(IntPtr hWnd, ref Margins pMargins);
[StructLayout(LayoutKind.Sequential)]
struct Margins
{
public int cxLeftWidth;
public int cxRightWidth;
public int cyTopHeight;
public int cyBottomHeight;
}
Then you can use this to "pull down" glass from the top of the window down into the client area:
GlassMargins.Top = 40;
GlassMargins.Left = 0;
GlassMargins.Right = 0;
GlassMargins.Bottom = 0;
DwmExtendFrameIntoClientArea(this.Handle, ref GlassMargins);
From here, you can go on and do other things, like draw text or images onto the glass, or put controls on it, such as a Office 2007 style application button.