Valhalla Legends Archive

Programming => General Programming => Topic started by: PaiD on September 02, 2005, 07:06 PM

Title: Transparent Controls.
Post by: PaiD on September 02, 2005, 07:06 PM
I am working on getting a Listview's background to become transparant. When I try the whole control is tranparant and I was hoping where was another way to do this or if I am doing it wrong. I use the same thing on my Rich Text Box and it works flawless and I only see the text that was displayed on it. How ever the listview just disapears.


Public Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long

Public Const GWL_EXSTYLE = (-20)
Public Const WS_EX_TRANSPARENT = &H20


SetWindowLong frmMain.rtbMain.hwnd, GWL_EXSTYLE, WS_EX_TRANSPARENT
' That works
'SetWindowLong frmMain.lvUsers.HWnd, GWL_EXSTYLE, WS_EX_TRANSPARENT
' That works all to well and I dont see the text :p


Any ideas?
Title: Re: Transparent Controls.
Post by: MyndFyre on September 02, 2005, 08:21 PM
Custom draw the text on the list view?
Title: Re: Transparent Controls.
Post by: PaiD on September 03, 2005, 12:13 PM
MyndFyre: Which API's could I use to do this?
Title: Re: Transparent Controls.
Post by: Blaze on September 03, 2005, 12:18 PM
I'd think either DrawText (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdi/fontext_0odw.asp), DrawTextEx (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdi/fontext_0odw.asp), or TextOut (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdi/fontext_0odw.asp)