본문 바로가기

DEV/VB

VisualBasic 폼의 투명도 설정하기

반응형
' 선언부
' ### 투명화 관련
Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long) As Long
Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Private Declare Function SetLayeredWindowAttributes Lib "user32" (ByVal hWnd As Long, ByVal crKey As Long, ByVal bAlpha As Byte, ByVal dwFlags As Long) As Long

' 사용시
MakeLayeredWnd Me.hWnd
SetLayeredWindowAttributes Me.hWnd, 0, 255 * (투명도), LWA_ALPHA
반응형
댓글