alexa-tracking

Main Content

1024
1024
KASKUS
51
244
https://www.kaskus.co.id/thread/5300bf03108b46ed5c8b458a/vb6cara-membuat-form-transparant
[VB6]Cara Membuat form Transparant
pertama buat form standard Exe kemudian paste kan code tersebut di Form_load
Code:
SetTransparan Me.hwnd, 200, True 'yang angka 200 itu adalah set stransfarannya


kedua buat 1modul baru dan pastekan code berikut
Code:
Private Declare Function _
SetLayeredWindowAttributes Lib "user32.dll" _
(ByVal hwnd As Long, ByVal crKey As Long, _
ByVal bAlpha As Byte, _
ByVal dwFlags As Long) As Long

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

Public Sub SetLayeredWindow(ByVal hwnd _
As Long, ByVal bIslayered As Boolean)
Dim WinInfo As Long
WinInfo = GetWindowLong(hwnd, -20)
If bIslayered = True Then
WinInfo = WinInfo Or 524288
Else
WinInfo = WinInfo And Not 524288
End If
SetWindowLong hwnd, -20, WinInfo
End Sub

Public Sub SetTransparan(ByVal hwnd _
As Long, ByVal Opacity As Byte, _
IsTransparent As Boolean)
If IsTransparent = True Then
SetLayeredWindow hwnd, True
SetLayeredWindowAttributes hwnd, _
0, Opacity, 2
ElseIf IsTransparent = False Then
SetLayeredWindow hwnd, False
End If
End Sub


VB.net:
Code:
Me.Opacity = 0.5

angka 0.5 bisa diganti dengan range value: 1 s/d 0
emoticon-Sundul Gan (S)emoticon-Sundul Gan (S)emoticon-Sundul Gan (S)
emoticon-Sundul Gan (S)emoticon-Sundul Gan (S)emoticon-Sundul Gan (S)
emoticon-Sundul Gan (S)emoticon-Sundul Gan (S)emoticon-Sundul Gan (S)
emoticon-Sundul Gan (S)emoticon-Sundul Gan (S)emoticon-Sundul Gan (S)