Hi > how would one produce a matching quiz on a gui like so
If unclear, there is a need for
(a) each box in column A being linked to one in column B and when clicked in succession they remain checked - otherwise both get unchecked
(b) it being possible to repeat this process for all other pairs until all boxes are permachecked
If it is a lot of work to write from scratch I could provide the complete convoluted clusterfunhouse of an attempt I have been despairing over
Thank yous
Gui matching quiz?
Re: Gui matching quiz?
Here are a few ideas.
Code: Select all
map := {a1: "b4", a2: "b3", a3: "b2", a4: "b1"}
Gui, Font, s10
Gui, Add, CheckBox, va1 gCheck, a1
Gui, Add, CheckBox, x+m vb1 gCheck, b1
Gui, Add, CheckBox, xm va2 gCheck, a2
Gui, Add, CheckBox, x+m vb2 gCheck, b2
Gui, Add, CheckBox, xm va3 gCheck, a3
Gui, Add, CheckBox, x+m vb3 gCheck, b3
Gui, Add, CheckBox, xm va4 gCheck, a4
Gui, Add, CheckBox, x+m vb4 gCheck, b4
enable(active := "a")
Gui, Show,, Matching
Return
Check:
Gui, Submit, NoHide
If !(%A_GuiControl%) {
a := active = "a" ? "" : a
Return
}
Switch active {
Case "a": a := A_GuiControl
Case "b": If (A_GuiControl != map[a]) {
GuiControl,, %A_GuiControl%, 0
GuiControl,, %a%, 0
} Else SoundBeep, 1500
}
enable(active := active = "a" ? "b" : "a")
Return
enable(letter) {
other := letter = "a" ? "b" : "a"
Loop, 4 {
GuiControl, Enable , %letter%%A_Index%
GuiControl, Disable, %other%%A_Index%
}
}
Re: Gui matching quiz?
Thank you for your time mikeyww!
Unfortunately though AHK does not recognise "Switch active [" on line 53
But it's ok if you or anyone else doesn't feel like tweaking it, I could always set one up on a quiz site or app
Unfortunately though AHK does not recognise "Switch active [" on line 53
But it's ok if you or anyone else doesn't feel like tweaking it, I could always set one up on a quiz site or app
Who is online
Users browsing this forum: Dewi Morgan, RSable and 395 guests