How to fade out a Gui with function + variable?

Get help with using AutoHotkey and its commands and hotkeys
User avatar
Scr1pter
Posts: 370
Joined: 06 Aug 2017, 08:21
Location: Germany

How to fade out a Gui with function + variable?

15 Sep 2018, 15:16

Hello,

I created a script which consists of a Gui with a picture inside of it.
Additionally, there is also a fade-in and a fade-out effect which works perfectly.

I use this Gui in scripts which take some seconds until they have finished.
(Just to inform the user that a script is being run.)

By using the include function, I add my Gui script into any other script.
It looks like this:

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus



I call it from another script by this way:

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus



When I press F1, the Start image appears but starts disappearing after 800 ms, which is logical.
I would like that it stays until it gets the information/command to disappear.

I think I will need to include a variable which tells the Start() function when to fade out.
Something like this:

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus




Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus



In this case, it stays forever when pressing F1 (or better when Start() gets called with 1.
As soon as it gets called with a 0, it starts disappearing, but it looks weird.
- it disappears immediately without any effect
- then it appears again without any effect
- after this is starts disappearing, but it doesn't look as smooth as the first code.

Maybe it's just a small issue.
I realized that the fade value has to be set to 226 in the 2nd code, otherwise the script "forgets" it.
This is how it looks like:
Image


Regards
I'm not an expert, just an enthusiastic AutoHotkey user. 8-)
Please do not support cheaters! :thumbdown:
Keyboard: Logitech G15 first generation - Mice: Logitech G9, G502, G602 - OS: Windows 7 Pro 64 Bit AHK version: 1.1.29.00

Return to “Ask For Help”

Who is online

Users browsing this forum: Adrulesok99, chngrcn, hanz79x, just me, newbieforever and 67 guests