How to link action to Gui button

Get help with using AutoHotkey (v2 or newer) and its commands and hotkeys
pgeugene
Posts: 40
Joined: 27 Jun 2019, 04:36

How to link action to Gui button

25 Apr 2024, 03:19

I tried to configure the button to link to my program with below commands but not working.

Code: Select all

Btn11 := MyGui.AddButton("xm ym w80 h24", "Info").OnEvent("Click", ButtonClick)
CreateImageButton(Btn11, 0, IBStyles["info"]*)

ButtonClick(*)
{
	Run (notepad)
}
Source code
viewtopic.php?p=556427#p556427

image.png
(16.34 KiB) Downloaded 24 times
reddyshyam
Posts: 55
Joined: 24 Jul 2023, 04:34

Re: How to link action to Gui button

25 Apr 2024, 04:12

Hi,

I think the below is wrong

Code: Select all

Btn11 := MyGui.AddButton("xm ym w80 h24", "Info").OnEvent("Click", ButtonClick)
It should be

Code: Select all

Btn11 := MyGui.AddButton("xm ym w80 h24", "Info")
Btn11.OnEvent("Click", ButtonClick)

Return to “Ask for Help (v2)”

Who is online

Users browsing this forum: AccelAHK, Draken, emp00, mikeyww, NorInd and 51 guests