Private Const WS_EX_TRANSPARENT = &H20&
Private Const GWL_EXSTYLE = (-20)
Private Declare Function SetWindowLong Lib "user32" _
Alias "SetWindowLongA" (ByVal hwnd As Long, _
ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Private Function MakeListTransparent(ListCtl As Object) As Boolean
On Error Resume Next
ListCtl.BackColor = ListCtl.Parent.BackColor
SetWindowLong ListCtl.hwnd, GWL_EXSTYLE, WS_EX_TRANSPARENT
MakeListTransparent = Err.LastDllError = 0
End Function
Usage
MakeListTransparent List1
It doesn't seem to work. The procedure removes the border but it keeps the bg color of the form, and doesn't allow the image to shine through. I removed Resume Next from the procedure, and there are no errors, and it just isn't working.
Brian Programming: VB5 Pro (SP3) - QBasic 1.1,4.5 Internet: HTML 4, CSS, JavaScript
Visit AltInt.com!
I'n not sure what the exe does, but the project behaves exactly the same as the code you gave me. When I commented out the lstControl.BackColor line, the only effect was the removal of the border. Perhaps I haven't been completely clear: I have an image in the BG, which I want to show through the listbox, not just a solid color.
Brian Programming: VB5 Pro (SP3) - QBasic 1.1,4.5 Internet: HTML 4, CSS, JavaScript
Visit AltInt.com!
One way to do this, is to keep the listbox invisible and each time wen the TopIndex changes, you have to redraw a picturebox (or something that holds the background image) using the Print statement (or TextOut API). This is also fast, so I think this would work just fine.