How do I add a picture to a button I'm too inexperienced Topic is solved

Get help with using AutoHotkey and its commands and hotkeys
wadeinator74
Posts: 1
Joined: 17 Jan 2017, 20:13

How do I add a picture to a button I'm too inexperienced

04 Apr 2020, 03:01

I made a program to turn off my computer when I'm across the room with a remote but I would accidentally press it too often so I'm trying to add a button that I can press to cancel the action. I figured out how to do all of this but now I want to make the button a black picture because the default color of the button is really bright and I'm usually turning off my pc with the remote because I'm falling asleep. I tried to figure it out but it seems very complicated to use a picture for the button.

Code: Select all

Gui, Add, Button, x0 y0 w2560 h1440 gCancel
Gui, +AlwaysOnTop -Caption +Border
Gui, Color, Black

AppsKey::
Gui, Show, x0 y0 w2558 h1440, The Gui
sleep 10000
Shutdown, 8
return,

Cancel:
Reload
User avatar
boiler
Posts: 5200
Joined: 21 Dec 2014, 02:44

Re: How do I add a picture to a button I'm too inexperienced  Topic is solved

04 Apr 2020, 03:33

The easiest way is just to add a picture instead of a button, and because it still has the gCancel option, it will still go to the Cancel label when you click the picture.

Code: Select all

Gui, Add, Picture, x0 y0 w2560 h1440 gCancel, C:\MyPath\MyPic.jpg
Gui, +AlwaysOnTop -Caption +Border
Gui, Color, Black

AppsKey::
Gui, Show, x0 y0 w2558 h1440, The Gui
sleep 10000
Shutdown, 8
return,

Cancel:
Reload
Last edited by boiler on 04 Apr 2020, 04:01, edited 1 time in total.
User avatar
Hellbent
Posts: 1057
Joined: 23 Sep 2017, 13:34

Re: How do I add a picture to a button I'm too inexperienced

04 Apr 2020, 03:43

To add to what Boiler said, you can also check out
ImageButtons by justme for a more advanced method.

Return to “Ask For Help”

Who is online

Users browsing this forum: Bing [Bot], Oldboy, swagfag, Wigi and 151 guests