2
votes

I have a GUI window with AutoHotkey but I can't figure out how to change the picture. I looked into GuiControl but the documentation is really lacking (especially examples). My code so far:

Gui,Add,Picture,w300 h-1,first.png
Gui,Add,Button,x60 w80 h30, Start
Gui,Show
Return

GuiClose:
ExitApp
Return

ButtonStart:
;How can I change the picture?
return
1

1 Answers

3
votes

You need to set an associated variable to the control.

Gui,Add,Picture,w300 h-1 vMyPicture, first.png
Gui,Add,Button,x60 w80 h30, Start
Gui,Show
Return

GuiClose:
ExitApp
Return

ButtonStart:
    GuiControl,, MyPicture, second.png
return