On Gui Resize Event

Thought I'd put this down as it took me ages to search the Internet for this solution.  In the end, I found it hidden away in the Autohotkey help file and not under the gui events...

The issue here is if you want to do something when a user resizes your program. 

If you search and search, you'll find that GuiClose responds to when you close the app, and GuiSize will run when you resize the app.



	GuiControl, MoveDraw, MainRedBackground, w%A_GuiWidth% h%A_GuiHeight%
  1.  GuiSize: 
  2.      GuiControl, MoveDraw, MainRedBackground, w%A_GuiWidth% h%A_GuiHeight% 
  3.  Return 

If I just used GuiControl, Move, ... then this would be as above but if you are using images, then you will get problems with the image repeating... so use moveDraw which redraws the app. This will result in flickering but it's better than if it isn't redrawing.

Category: AutoHotkey :: Article: 224

Credit where Credit is Due:

Feel free to copy, redistribute and share this information. All that we ask is that you attribute credit and possibly even a link back to this website as it really helps in our search engine rankings.

Disclaimer: The information on this website is provided without warranty and any content is merely the opinion of the author. Please try to test in development environments prior to adapting them to your production environments. The articles are written in good faith and, at the time of print, are working examples used in a commercial setting.

Thank you for visiting and, as always, we hope this website was of some use to you!

Kind Regards,

Joel Lipman

Related Articles

Joes Revolver Map


Badge - Certified Zoho Creator Associate
Badge - Certified Zoho Creator Associate

Donate & Support

If you like my content, and would like to support this sharing site, feel free to donate using a method below:

Donate to Joel Lipman via PayPal

Donate to Joel Lipman with Bitcoin - Valid till 8 May 2022 bc1qjtp4l4ra452wzvuk9a45yfj82zkahsyy2z379y
© 2023 Joel Lipman .com. All Rights Reserved.