Depending on what is in the GUI Combobox, a result appears to the right of it.
Code: Select all
#SingleInstance force
#Persistent
SelectVal := "123|456||789"
Gui 1: Font, s16 Normal, Arial
Gui 1: Add, ComboBox, w90 h150 vChoice gCheckChoice, %SelectVal%
Gui 1: Font, cPurple s16 Bold, Arial
Gui 1: Add, Text, xp+100 yp+2 w130 h20 vChoiceText hidden
; Gui 1: Add, Button, xm y+30 gValueCheck, OK!
; Gui +alwaysOntop
Gui 1: Show, x100 y100 w300 h150, %A_ScriptName%
Return
CheckChoice:
Gui 1: Submit, NoHide
GuiControl 1: Show, ChoiceText
If (Choice = 123)
{ Result = Green
Goto Next
}
If (Choice = 456)
{ Result = Blue
Goto Next
}
If (Choice = 789)
{ Result = Red
Goto Next
}
Result := "Undefined"
Next:
Gui 1: Font, c%Result% s16 Bold, Arial
GuiControl 1: Text, ChoiceText, %Result%
Return
1)
In the example I have set 456 as default.
The 456 is selected when the program starts, but I don't get the result "Blue"
Is it possible to see the results even when the program starts?
How?
2)
I tried to change the color on the text, depending on the result - but I failed.
Is it difficult to solve?
How to do it?