Control transparency of elements on a GUI Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
poisonborz
Posts: 9
Joined: 03 Nov 2015, 17:59

Control transparency of elements on a GUI

06 Dec 2020, 12:28

Hey, is there a way to add transparent elements to a GUI in a way that their transparency is controllable?
Like this: i.imgur.com/f6t51yz.jpg

Is GDIP the only way? My theory is, that if this can't be done with AHK only, there would be a separate GDIP layer needed that would move with the AHK window... but this seems to be really cumbersome for a very simple thing. Is there a better way?
tmplinshi
Posts: 1604
Joined: 01 Oct 2013, 14:57

Re: Control transparency of elements on a GUI  Topic is solved

07 Dec 2020, 01:30

You can use WinSet, Transparent

Code: Select all

Gui, Add, Picture, HWNDhPic, % A_AhkPath
Gui, Add, Slider, w300 Range0-255 ToolTip vTransVal gChangeTransparency, 255
Gui, Show
Return

ChangeTransparency:
	GuiControlGet, TransVal
	WinSet, Transparent, %TransVal%, ahk_id %hPic%
Return

GuiClose:
ExitApp
poisonborz
Posts: 9
Joined: 03 Nov 2015, 17:59

Re: Control transparency of elements on a GUI

07 Dec 2020, 03:55

Ooooh thanks, I always thought WinSet commands can only just affect the whole window 🤦‍♂️
just me
Posts: 9511
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: Control transparency of elements on a GUI

07 Dec 2020, 04:50

FYI, this use of WinSet requires Win 8+.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Bing [Bot], george-laurentiu, peter_ahk and 88 guests