So, you'd have to connect each event to a control
and then it's respective code block? That seems like a lot of work to just get something to happen on any click event. it just feels like overkill to me. What if I have 8 buttons?
Code: Select all
Gui, Add, Button, vbtn1
Gui, Add, Button, vbtn2
Gui, Add, Button, vbtn3
Gui, Add, Button, vbtn4
Gui, Add, Button, vbtn5
Gui, Add, Button, vbtn6
Gui, Add, Button, vbtn7
Gui, Add, Button, vbtn8
GuiEventConnect(btn1, "MyGuiEventForBtn1_")
GuiEventConnect(btn2, "MyGuiEventForBtn2_")
GuiEventConnect(btn3, "MyGuiEventForBtn3_")
GuiEventConnect(btn4, "MyGuiEventForBtn4_")
GuiEventConnect(btn5, "MyGuiEventForBtn5_")
GuiEventConnect(btn6, "MyGuiEventForBtn6_")
GuiEventConnect(btn7, "MyGuiEventForBtn7_")
GuiEventConnect(btn8, "MyGuiEventForBtn8_")
MyGuiEvent1_Close(this) {
}
MyGuiEvent1_Size(this, w, h) {
}
MyGuiEvent2_Close(this) {
}
MyGuiEvent2_Size(this, w, h) {
}
MyGuiEvent3_Close(this) {
}
MyGuiEvent3_Size(this, w, h) {
}
MyGuiEvent4_Close(this) {
}
MyGuiEvent4_Size(this, w, h) {
}
MyGuiEvent5_Close(this) {
}
MyGuiEvent5_Size(this, w, h) {
}
MyGuiEvent6_Close(this) {
}
MyGuiEvent6_Size(this, w, h) {
}
MyGuiEvent7_Close(this) {
}
MyGuiEvent7_Size(this, w, h) {
}
MyGuiEvent8_Close(this) {
}
MyGuiEvent8_Size(this, w, h) {
}