alertsla.blogg.se

Ahk studio
Ahk studio








It can often condense your code considerably to have a fewer number of more generic event handlers.

ahk studio

When you have 20 checkboxes it can really be useful to loop through them.Īlso, this shows that every control event does not have to go to a separate function. Also by using an object structure, you can loop easily through controls as shown here when clearing the Edit controls. I find it very useful to keep all handles for a particular Gui within the same object that holds the Gui. This is really more about how to organize things for when you get a lot of Gui with lots of controls. MsgBox "Stuff: " "`nOther Stuff: " įor EditName, EditCtrl in () GuiMain.Add("Button", "xm+300 yp w150", "Clear").OnEvent("Click", guiMain_Button_Click) GuiMain.Add("Button", "Default y+20 xm+100 w150", "Confirm").OnEvent("Click", guiMain_Button_Click) Gui1.OnEvent('Escape', escapeGUI) Define event for GUI escapeĪctivated(btn, info) Gui1.AddLink(, 'Button with event | ' Add URLsĮd := gui1.AddEdit('w400') Add an edit controlītn := gui1.AddButton('wp Default', 'OK') Add a buttonītn.OnEvent('Click', activated) Define event for button click Gui1 := Gui('+AlwaysOnTop', 'Button action (F3 = Show again)'), gui1.SetFont('s10') Set up GUI

ahk studio

Check documentation for the needed function parametersĪhkDoc := "" URL for AHK v2 function index

ahk studio ahk studio

Use guiName.OnEvent or controlName.OnEvent to map events to functionsģ. Name the controls that will have events (i.e., assign control objects to variables)Ģ. This script shows an example of a GUI with a button that calls a function via OnEvent.ġ. Code: Select all /* GUI example for AHK v2.










Ahk studio