我一直在尝试将空气动力效果应用于vb .net表单并且遇到了相当多的代码,虽然我无法使用任何实际应用空气动力效果。 我一直在使用的代码是: -
<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
但它不起作用,即使我创建了Side的对象,我找不到任何方法让它真正起作用
Dim s As Side = New Side
s.Left = 0
s.Right = 0
s.Top = 0
s.Bottom = 0
答案 0 :(得分:1)
您的代码的问题是您需要将变量Left,Right,Top和Bottom的值设置为-1而不是0。 代码应该是: -
Dim s As Side = New Side
s.Left = -1
s.Right = -1
s.Top = -1
s.Bottom = -1
Me.BackColor = Color.Blue;
这会使你的表格具有蓝色的空气效果