| | |
TransParent Control
![]() |
Try this code to first create a transparent window:
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
Private Const GWL_EXSTYLE = (-20)
Private Const WS_EX_LAYERED = &H80000
Private Const LWA_ALPHA = &H2
Private Sub Command1_Click()
Dim f2 As New Form2
f2.show
Call SetWindowLong(f2.hWnd, GWL_EXSTYLE, GetWindowLong(f2.hWnd, GWL_EXSTYLE) Or WS_EX_LAYERED)
Call SetLayeredWindowAttributes(f2.hWnd, 0, 255 / 2, LWA_ALPHA) ' 50% translucent
End Sub
You can modify this code to use for textbox control or command button.
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
Private Const GWL_EXSTYLE = (-20)
Private Const WS_EX_LAYERED = &H80000
Private Const LWA_ALPHA = &H2
Private Sub Command1_Click()
Dim f2 As New Form2
f2.show
Call SetWindowLong(f2.hWnd, GWL_EXSTYLE, GetWindowLong(f2.hWnd, GWL_EXSTYLE) Or WS_EX_LAYERED)
Call SetLayeredWindowAttributes(f2.hWnd, 0, 255 / 2, LWA_ALPHA) ' 50% translucent
End Sub
You can modify this code to use for textbox control or command button.
hi bredes you post a same thread again.
cek your own post (TransParant Control)
try this thread, its a similiar thread like your post
Control Transparant Form
Ok.
all for the best
cek your own post (TransParant Control)
try this thread, its a similiar thread like your post
Control Transparant Form
Ok.
all for the best
Never tried = Never Know
So, Please do something before post your thread.
* PM Asking will be ignored *
So, Please do something before post your thread.
* PM Asking will be ignored *
![]() |
Similar Threads
- transparence of control (Visual Basic 4 / 5 / 6)
- How to restore transparent desktop icon (Windows NT / 2000 / XP)
- How do I password protect folders? (Windows NT / 2000 / XP)
- Transparent RichText Box (C#)
- Transparent Icons on Desktop? (Windows NT / 2000 / XP)
- How to make label backstyle transparent (C#)
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: How to read excel cells into Array
- Next Thread: Some Good ActiveX
Views: 3611 | Replies: 4
| Thread Tools | Search this Thread |
Tag cloud for Visual Basic 4 / 5 / 6
* 6 429 access activex append array basic beep blackjack bmp box c++ calculator calendar channel9 code college component copy creative data database date delete desktop dissertations dissertationthesis dissertationtopic error excel file form game grid group hardware header icon image implements installer key keypress label listview liveperson machine macro mail match measure memory messagebox microsoft number object open oracle os outlook picture pos powerpoint prime print program programmer prompt query random range-objects readfile record report reports save score search size sort sound spectateswamp sql string sum table time timer variable vb vb6 vb6.0 vba vista visual visualbasic web window windows







. i just want control textbox or commandbutton transparent
.