I know how to set up a GUI, which responds to the users input.
For instance this very basic one:
Code: Select all
Sleep, 250
Gui, Destroy
Gui, Add, Text,, Age
Gui, Add, Edit, vAge,
Gui, Add, Text,, Gender:
Gui, Add, DropDownList, vGender, Male|Female|Nonbinary|
Gui, Add, Button, default, OK
Gui, Show,, Test
return
GuiClose:
ButtonOK:
Gui, Submit
Sleep, 250
If (Gender = "Male")
{
Sleep, 250
Gui, 2:Destroy
Gui, 2:Add, Text, xm y+10 w170, How cool are you?
Gui, 2:Add, DropDownList, x+m w168 vC1, Mildly cool|Very cool|
Gui, 2:Add, Button, default, OK
Gui, 2:Show,, Male
return
2GuiClose:
2ButtonOK:
Gui, 2:Submit
ExitApp
}
If (Gender = "Female")
{
Sleep, 250
Gui, 3:Destroy
Gui, 3:Add, Text, xm y+10 w170, How cool are you?
Gui, 3:Add, DropDownList, x+m w168 vC2, Mildly cool|Very cool|
Gui, 3:Add, Button, default, OK
Gui, 3:Show,, Female
return
3GuiClose:
3ButtonOK:
Gui, 3:Submit
ExitApp
}
If (Gender = "Nonbinary")
{
Sleep, 250
Gui, 4:Destroy
Gui, 4:Add, Text, xm y+10 w170, How cool are you?
Gui, 4:Add, DropDownList, x+m w168 vC3, Mildly cool|Very cool|
Gui, 4:Add, Button, default, OK
Gui, 4:Show,, Nonbinary
return
4GuiClose:
4ButtonOK:
Gui, 4:Submit
ExitApp
}
For instance in GUI2. The user is asked "How cool are you?" I want the script to respond to this input by opening another GUI - but I can't. Take this example:
Code: Select all
Sleep, 250
Gui, Destroy
Gui, Add, Text,, Age
Gui, Add, Edit, vAge,
Gui, Add, Text,, Gender:
Gui, Add, DropDownList, vGender, Male|Female|Nonbinary|
Gui, Add, Button, default, OK
Gui, Show,, Test
return
GuiClose:
ButtonOK:
Gui, Submit
Sleep, 250
If (Gender = "Male")
{
Sleep, 250
Gui, 2:Destroy
Gui, 2:Add, Text, xm y+10 w170, How cool are you?
Gui, 2:Add, DropDownList, x+m w168 vC1, Mildly cool|Very cool|
Gui, 2:Add, Button, default, OK
Gui, 2:Show,, Male
return
2GuiClose:
2ButtonOK:
Gui, 2:Submit
Sleep, 250
If (C1 = Mildly cool)
{
Sleep, 250
Gui, 5:Destroy
Gui, 5:Add, Text, xm y+10 w170, Are you ok with that?
Gui, 5:Add, DropDownList, x+m w168 vO1, Yes|No|
Gui, 5:Add, Button, default, OK
Gui, 5:Show,, Mildly cool male
return
5GuiClose:
5ButtonOK:
Gui, 5:Submit
}
ExitApp
}
If (Gender = "Female")
{
Sleep, 250
Gui, 3:Destroy
Gui, 3:Add, Text, xm y+10 w170, How cool are you?
Gui, 3:Add, DropDownList, x+m w168 vC2, Mildly cool|Very cool|
Gui, 3:Add, Button, default, OK
Gui, 3:Show,, Female
return
3GuiClose:
3ButtonOK:
Gui, 3:Submit
ExitApp
}
If (Gender = "Nonbinary")
{
Sleep, 250
Gui, 4:Destroy
Gui, 4:Add, Text, xm y+10 w170, How cool are you?
Gui, 4:Add, DropDownList, x+m w168 vC3, Mildly cool|Very cool|
Gui, 4:Add, Button, default, OK
Gui, 4:Show,, Nonbinary
return
4GuiClose:
4ButtonOK:
Gui, 4:Submit
ExitApp
}
Let it be known that the above examples are not related to the use we have of Autohotkey, but just an example to help me understand, what I am doing wrong...
Any help will be much appreciated.