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.

 

Syntax:

copyraw
GuiSize:
	GuiControl, MoveDraw, MainRedBackground, w%A_GuiWidth% h%A_GuiHeight%
Return
  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

Add comment

Your rating:

Submit

Accreditation

Badge - Zoho Creator Certified Developer Associate
Badge - Zoho Deluge Certified Developer
Badge - Certified Zoho CRM Developer

Donate & Support

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

Paypal:
Donate to Joel Lipman via PayPal

Bitcoin:
Donate to Joel Lipman with Bitcoin bc1qf6elrdxc968h0k673l2djc9wrpazhqtxw8qqp4

Ethereum:
Donate to Joel Lipman with Ethereum 0xb038962F3809b425D661EF5D22294Cf45E02FebF

Please publish modules in offcanvas position.