Author |
Topic: Transparent backgrounds (Read 245 times) |
|
Jack Kelly
Full Member
member is offline
Gender:
Posts: 106
|
|
Transparent backgrounds
« Thread started on: Aug 16th, 2016, 07:35am » |
|
Another question. Is there any way to make the background transparent for windows and/or controls. If so, it would make an easy job of placing a groupbox control in my visual designer program -- which I'm currently calling 'Freeform Lite'.
|
|
Logged
|
|
|
|
Richard Russell
Administrator
member is offline
Posts: 1348
|
|
Re: Transparent backgrounds
« Reply #1 on: Aug 16th, 2016, 08:31am » |
|
on Aug 16th, 2016, 07:35am, Jack Kelly wrote:Another question. Is there any way to make the background transparent for windows and/or controls. |
|
Does this LBPE article help? The code there can be modified to make just the background transparent as follows:
Code: Nomainwin
WindowWidth = 600
WindowHeight = 400
UpperLeftX = int((DisplayWidth-WindowWidth)/2)
UpperLeftY = int((DisplayHeight-WindowHeight)/2)
text$ = "This code was adapted from the Libby contest " + _
"entry, LB Window Spier, by John Richardson. " + _
"It will NOT work on Windows 98 or Windows 95."
Statictext #transp.txt1, text$, 20, 20, 550, 200
Stylebits #transp, 0, 0, _WS_EX_LAYERED, 0
Open "Transparent Window" for Window as #transp
#transp, "Trapclose EndDemo"
#transp, "Font Verdana 12 Bold"
hTransp = hWnd(#transp)
Call SetTransparent hTransp
Wait
Sub EndDemo handle$
Close #handle$
End
End Sub
Sub SetTransparent handle
CallDLL #user32, "GetSysColor", 15 as Long, buttonface as Long
CallDLL #user32, "SetLayeredWindowAttributes", _
handle as Ulong, _
buttonface as Long, _
0 as Long, _
_LWA_COLORKEY as Long, _
layer as Long
End Sub For other options see this more comprehensive article.
Richard.
|
|
|
|
Jack Kelly
Full Member
member is offline
Gender:
Posts: 106
|
|
Re: Transparent backgrounds
« Reply #2 on: Aug 17th, 2016, 07:09am » |
|
Thanks, Richard, for your quick response to my question yesterday. I'll keep that in my 'bag of tricks'...
|
|
Logged
|
|
|
|
|