3
Contributors
4
Replies
5
Views
9 Years
Discussion Span
Last Post by binoj_daniel
Featured Replies
  • 1

    hi bredes you post a same thread again. cek your own post ([URL="http://www.daniweb.com/forums/thread105511.html"]TransParant Control[/URL]) try this thread, its a similiar thread like your post [URL="http://www.daniweb.com/forums/thread104127.html"] Control Transparant Form[/URL] Ok. all for the best Read More

0

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.

0

thanks. for the coding. but i dont want it form transparent :'( . i just want control textbox or commandbutton transparent :) .

thank for the reply.

0

thanks. for the coding. but i dont want it form transparent :'( . i just want control textbox or commandbutton transparent :) .

thank for the reply.

By transparent do you mean it should match the color of the form?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.