Non-client area form modification issues

113 Views Asked by At

I seem to be having a few issues with the form on my project after I decided to extend the non client area by use of this code:

<Runtime.InteropServices.StructLayout(Runtime.InteropServices.LayoutKind.Sequential)> Public Structure Side
    Public Left As Integer
    Public Right As Integer
    Public Top As Integer
    Public Bottom As Integer

End Structure


<Runtime.InteropServices.DllImport("dwmapi.dll")> Public Shared Function DwmExtendFrameIntoClientArea(ByVal hWnd As IntPtr, ByRef pMarinset As Side) As Integer

End Function


Try
        Me.BackColor = Color.Black
        Dim Side As Side = New Side
        Side.Left = -1
        Side.Right = -1
        Side.Top = -1
        Side.Bottom = -1
        Dim result As Integer = dwmExtendFrameIntoClientArea(Me.Handle, Side)

    Catch ex As Exception

    End Try

The code isn't exact, just hopefully it can serve to give a better understanding of what I attempted to accomplish. The issue I'm having now with the black color now being used as transparency with aero. Some text colors that are supposed to be black are now reflecting the color of the current aero color theme as you can see in the examples as well as other color issues elsewhere such as the text highlight color as well.

enter image description here enter image description here enter image description here

Having the non client area extended is an important part of the project, so I can't deviate from that too much. Anyway I can try to have a color set designated for other things like this or some other kind of solution to resolve this? I'm a little fuzzy on meddling around with form stuff having to do with aero. Thanks!

0

There are 0 best solutions below