Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Set the form's transparency key to white. The color you choose as the transparency key is transparent-ed out. Anything on the entire form with that color is turned into transparent. As the browser's background is of white color, a white transparency key will make it transparent, you can use Windows Aero Glass DWM effect for a glassy transparency but it would only work on Windows Vista onwards, for previous version of Windows, you'll have to paint it manually which is a long job to do. The simplest and the most quickest thing for you is to set the Transparency Key to White :)</p> <pre><code>Me.TransparencyKey = Color.White </code></pre> <p><img src="https://i.stack.imgur.com/xnWpk.png" alt="enter image description here"></p> <p><img src="https://i.stack.imgur.com/oww1Q.png" alt="You can set the TransparencyKey in the form&#39;s properties"></p> <p>If you want to use Aero Glass DWM, use the code below:</p> <pre><code>Imports System.Drawing Imports System.Drawing.Drawing2D Imports System.Runtime.InteropServices Private mExtendedFrameMargins As MARGINS Protected Overrides Sub _ OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs) e.Graphics.SmoothingMode = SmoothingMode.AntiAlias 'use either one e.Graphics.SmoothingMode = SmoothingMode.HighQuality End Sub Private Sub Form1_Paint(ByVal sender As System.Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles MyBase.Paint If IsGlassEnabled() Then 'You should paint the extended frame black for proper composition, but I'm painting it white as you need it e.Graphics.FillRectangle(Brushes.White, 0, 0, Me.ClientRectangle.Width, mExtendedFrameMargins.cyTopHeight) End If End Sub Private Function IsGlassEnabled() As Boolean If Environment.OSVersion.Version.Major &lt; 6 Then Return False End If Dim isGlassSupported As Boolean = False DwmIsCompositionEnabled(isGlassSupported) Return isGlassSupported End Function &lt;DllImport("dwmapi.dll")&gt; _ Private Shared Function DwmIsCompositionEnabled(&lt;MarshalAs(UnmanagedType.Bool)&gt; ByRef pfEnabled As Boolean) As Integer End Function &lt;DllImport("dwmapi.dll")&gt; _ Private Shared Function DwmExtendFrameIntoClientArea(ByVal hwnd As IntPtr, ByRef pMarInset As MARGINS) As Integer End Function &lt;StructLayout(LayoutKind.Sequential)&gt; _ Private Structure MARGINS Public cxLeftWidth As Integer Public cxRightWidth As Integer Public cyTopHeight As Integer Public cyBottomHeight As Integer End Structure Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load If IsGlassEnabled() Then mExtendedFrameMargins = New MARGINS mExtendedFrameMargins.cyTopHeight = Me.Height 'type height here, this is going to be a number (integer) DwmExtendFrameIntoClientArea(Me.Handle, mExtendedFrameMargins) End If End Sub </code></pre> <p>I've used this code in an app that I'm creating <img src="https://i.stack.imgur.com/ByW8J.jpg" alt="enter image description here"></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload