How do I refresh if MDIParent.Refresh/.Invalidate dont do anything? I want it to refresh immediatly after setting the style. This is how I removed the border.
Public Shared Sub MDIInside3dBorder(ByVal mdi As Form, ByVal Flag As Boolean)
If mdi Is Nothing Then Exit Sub
If mdi.IsMdiContainer Then
Dim x As String = " "
Declares.GetClassName(mdi.Handle, x, x.Length)
x = Replace(x, "Window.8", "MDICLIENT")
Dim curstyle As Integer, newstyle As Integer
Dim hwnd As IntPtr = Declares.FindWindowEx(mdi.Handle, IntPtr.Zero, x, vbNullString)
If hwnd.Equals(hwnd.Zero) Then Exit Sub
curstyle = Declares.GetWindowLong(hwnd, Constants.GWL_EXSTYLE)
If Flag Then
curstyle = curstyle Or Constants.WS_EX_CLIENTEDGE
Else
curstyle = curstyle And (Not Constants.WS_EX_CLIENTEDGE)
End If
newstyle = Declares.SetWindowLong(hwnd, Constants.GWL_EXSTYLE, curstyle)
'Refresh HERE with newstyle
End If
End Sub
Thanks!
I know I posted this earlier, but got pushed down.