Aero Glass And Text Problem

Topics: Developer Forum
Jan 23, 2012 at 7:19 PM
I have a problem with the text in the texbox...It becomes trasnsporament
when i put it on a form with aero glass effect!
>
> The aero glass effect code i'm using is this:
> ----------------------------------------------------------------------------------------------------
> Imports System.Runtime.InteropServices
> Public Class Form1
>
>     <StructLayout(LayoutKind.Sequential)> _
>     Public Structure MARGINS
>         Public cxLeftWidth As Integer
>         Public cxRightWidth As Integer
>         Public cyTopHeight As Integer
>         Public cyButtomheight As Integer
>     End Structure
>     <DllImport("dwmapi.dll")> _
>     Private Shared Function DwmExtendFrameIntoClientArea(ByVal hwnd As
> IntPtr, ByRef margin As MARGINS) As Integer
>     End Function
>
> Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
> System.EventArgs) Handles MyBase.Load
>
>         Me.BackColor = Color.Black
>         Dim mg As MARGINS = New MARGINS
>         mg.cxLeftWidth = 0
>         mg.cxRightWidth = 0
>         mg.cyTopHeight = 0
>         mg.cyButtomheight = 712
>         'set all value -1 to apply glass effect to the all of visible window
>         Try
>             DwmExtendFrameIntoClientArea(Me.Handle, mg)
>         Catch ex As Exception
>         End Try
>    End Sub
> End Class
Jan 23, 2012 at 8:40 PM

I Just Found the Solution!!You have to set the back color of the form to black and the transparencykey to a color that you are not going to use anywhere in your design.After that at the above part of the code you should change the :

 Me.BackColor = Color.Black

TO:
 Me.BackColor = Color.Coral(For Exaple If you set the tranparencykey to Coral)