就是这种效果
前提条件:系统属性-高级-性能-设置-在窗口下显示阴影-打开
代码:
一、在模块中加入如下申明:
'窗体阴影
Public Const CS_DROPSHADOW As Integer = &H20000
Public Const GCL_STYLE As Integer = (-26)
Public Declare Function SetClassLong Lib "user32" Alias "SetClassLongA" (ByVal hwnd As Integer, ByVal nIndex As Integer, ByVal dwNewLong As Integer) As Integer
Public Declare Function GetClassLong Lib "user32" Alias "GetClassLongA" (ByVal hwnd As Integer, ByVal nIndex As Integer) As Integer
二、在窗体中引入命名空间:
Imports System.Runtime.InteropServices
Imports System.Runtime
三、在窗体的启动代码中加入下面代码:
SetClassLong(Me.Handle, GCL_STYLE, GetClassLong(Me.Handle, GCL_STYLE) Or CS_DROPSHADOW)