'代碼一: 一個半透明表單
Private Sub Form_Load()Sub Form_Load()
Dim rtn As Long
rtn = GetWindowLong(hwnd, GWL_EXSTYLE)
rtn = rtn Or WS_EX_LAYERED
SetWindowLong hwnd, GWL_EXSTYLE, rtn
SetLayeredWindowAttributes hwnd, 0, 200, LWA_ALPHA
End Sub
'代碼二: 形狀不規則的表單
'Private Sub Form_Load()
' Dim rtn As Long
' BorderStyler = 0
' rtn = GetWindowLong(hwnd, GWL_EXSTYLE)
' rtn = rtn Or WS_EX_LAYERED
' SetWindowLong hwnd, GWL_EXSTYLE, rtn
' SetLayeredWindowAttributes hwnd,RGB(255,0,0),0,LWA_COLORKEY'將扣去視窗中的紅色
'End Sub