Code: Select all
#Requires AutoHotkey v2.0-beta
#n::
{
MyGui := Gui()
MyBtn := MyGui.Add("Button", "Default w80", "OK")
MyBtn.OnEvent("Click", MyBtn_Click()) ; 当点击时调用 MyBtn_Click.
}
MyBtn_Click() {
Msgbox "OK"
}
But when I press Win+n, the MyBtn_Click function seems to be executed immediately.
But according to the introduction in the documentation, this function should be called after I click the OK button?