ok i have these delcared at the top
VB Code:
'/ api used to make the form invisible 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.dll" (ByVal hwnd As Long, ByVal crKey As Long, ByVal bAlpha As Byte, ByVal dwFlags As Long) As Long '/ constants for transparate form Const LWA_COLORKEY = &H1 Const LWA_ALPHA = &H2 Const GWL_EXSTYLE = (-20)
and this in the form_load event
VB Code:
Dim Ret As Long Dim clr As Long Dim Ret1 As Long Dim clr1 As Long Me.BackColor = vbRed lstIP.BackColor = vbRed clr = vbRed ' RGB(255, 0, 0) 'Color for Transparent part of form Ret = GetWindowLong(Me.hwnd, GWL_EXSTYLE) Ret = Ret Or WS_EX_LAYERED SetWindowLong Me.hwnd, GWL_EXSTYLE, Ret SetLayeredWindowAttributes Me.hwnd, clr, 128, LWA_COLORKEY SetWindowLong lstIP.hwnd, GWL_EXSTYLE, WS_EX_TRANSPARENT
i have a picturebox as the form (the form itself is borderless so the picbackground is seen as the form).
now i have this listbox (lstip), i want to be able to make the listbox transparent enough to show the picbackground.
the problem is that instead of being transparent it becomes totally see through and shows things behind the form such as the desktop.
this is not the case if the form isnt made transparent.
i hope i am clear in my request.![]()




Reply With Quote