Click to Rate and Give Feedback
MSDN
MSDN Library
Visual Studio .NET
Windows Forms
 Creating Transparent Windows Forms
Visual Studio
Creating Transparent Windows Forms

With Microsoft Windows XP, you can control the opacity of windows that are displayed. To make a form more transparent, adjust its Opacity property.

Note   As transparent forms are only supported in Windows 2000 or later, Windows Forms will be completely opaque when run on older operating systems, such as Windows 98, regardless of the value set for the Opacity property.

To control the opacity of Windows Forms

  • In the Properties window, set the Opacity property to a value between 0.0 (complete transparency) and 1.0 (complete opacity).

To control the opacity of Windows Forms programmatically

  • In a method, set the Opacity property to a percentage between 0.0 (complete transparency) and 1.0 (complete opacity). The Opacity property is a Double value type.
    ' Visual Basic
    Public Sub MakeSeeThru()
       frmTransparentForm.Opacity = 0.83
    End Sub
    
    // C#
    public void MakeSeeThru()
    {
       frmTransparentForm.Opacity = 0.83;
    }
    
    // C++
    public:
       void MakeSeeThru()
       {
          frmTransparentForm->Opacity = 0.83;
       }

See Also

Introduction to Windows Forms | Creating Windows Forms | Dialog Boxes in Windows Forms

© 2008 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker