In a GUI, I have the following Button:
Code: Select all
...
gui, Add, Button, x51 yp w79 Center gChooseDest vDestUser, Idefix2
...
ChooseDest(){
DestUser:=AskForUser()
GuiControl,,DestUser,%Destuser%
msgbox DestUser: %DestUser%
}
The msgbox displays that name correctly (so I know that AskForUser works correctly), but the GuiControl command does not change the caption of the button. The caption is still idefix2, while the chosen username is Verleihnix.
DestUser is superglobal, so I don't need to declare it as global in ChooseDest. When I display the variables in the AHK main window, it shows the global variable DestUser with the correct value.