Using BoundFunc with Gui gLabels

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Gibbons
Posts: 93
Joined: 20 Sep 2016, 20:39

Using BoundFunc with Gui gLabels

18 Mar 2020, 12:45

Can somebody clean up this code? I get a "Target Label Does Not Exist" error for "boundfunc"

Code: Select all

Gui, Main:New, , CDL Trainer and Practice Test Emulator
Gui, Font, s16
Gui, Color, 93C572
Gui, Add, Tab3, w960 h580, General CDL|Passenger|School Bus|Air Brakes

Gui, Tab, Air Brakes
Gui, Add, Text, x50 y60, Air Brake Practice Groups (Do these first)
Gui, Add, Radio, Group vAirGroup1, Air Brake Practice Questions Group 1.  30 Questions
Gui, Add, Radio, vAirGroup2 x50 y+10, Air Brake Practice Questions Group 2.  30 Questions
Gui, Add, Radio, vAirGroup3 x50 y+10, Air Brake Practice Questions Group 3.  30 Questions
Gui, Add, Radio, vAirGroup4 x50 y+10, Air Brake Practice Questions Group 4.  31 Questions
Gui, Add, Radio, vAirGroup5 x50 y290, Comprehensive Air Brake Practice Questions  121 Questions
Gui, Add, Radio, vAirGroup6 x50 y385, Air Brake Practice Test. (Random Questions)  25 Questions
Gui, Add, Text, x50 y255, Comprehensive Air Brake Practice. (Do this second)
Gui, Add, Text, x50 y350, Practice Test (Do this third)
Gui, Add, Button, x50 y525 gBoundFunc, Answer Questions
Gui, Add, Button, x895 y525 gOnExit, Exit

Gui, show, w1000 h600
BoundFunc := func("Real").bind(AirGroup1, AirGroup2, AirGroup3, AirGroup4, AirGroup5, AirGroup6)
return

Real(AirGroup1, AirGroup2, AirGroup3, AirGroup4, AirGroup5, AirGroup6)
{
	msgbox, % AirGroup1
	msgbox, % AirGroup2
	msgbox, % AirGroup3
	msgbox, % AirGroup4
	msgbox, % AirGroup5
	msgbox, % AirGroup6
}
User avatar
SuperFoobar
Posts: 83
Joined: 23 Nov 2018, 15:14

Re: Using BoundFunc with Gui gLabels

18 Mar 2020, 13:46

They way you associate the function object to a control after you define the control and create the function object is with:

Code: Select all

GuiControl +g, ControlID, % FuncObj
I recommend using the HWND of the control for the ControlID by specifying +HWND on the control instead of using the control variable name.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: No registered users and 395 guests