How do I get GuiControl to work on Gui 2 instead of 1?
I tried Gui 2:+LastFound, but that doesn't work. When I click the Options button, it enables the control on the wrong Gui. Once Gui 2 is open, clicking the checkbox toggles the DateTime control properly.
Code:
Gui, 1:Add, Button,,Options
Gui, 1:Add, DateTime, vTestControl Disabled, Time
bReminderOn := True
Gui, 2:Add, Checkbox, vbReminderOn gReminderTimeChecked Checked%bReminderOn%, Remind me at:
Gui, 2:Add, DateTime, vReminderTime Disabled, Time
Gui, 1:Show
Return
ButtonOptions:
{
If bReminderOn
{
Gui 2:+LastFound
GuiControl, Enable, ReminderTime
GuiControl, Enable, TestControl
}
Else
{
Gui 2:+LastFound
GuiControl, Disable, ReminderTime
GuiControl, Disable, TestControl
}
Gui, 2:Show
Return
}
ReminderTimeChecked:
{
If bReminderOn
{
bReminderOn := False
Gui 2:+LastFound
GuiControl, Disable, ReminderTime
}
Else
{
bReminderOn := True
Gui 2:+LastFound
GuiControl, Enable, ReminderTime
}
Return
}