2013-07-16 55 views
0

我有這個小小的腳本,這是一個GUI實驗。但是,當我嘗試輸入數據並將其顯示在文本框中時,它不起作用。有誰知道爲什麼?AutoHotKey GUI不能正常工作

#SingleInstance force 
SetDefaultMouseSpeed, 10 

Gui, Add, Text,, First Name: 
Gui, Add, Text,, Middle Name: 
Gui, Add, Text,, Last Name: 
Gui, Add, Text,, Street 1: 
Gui, Add, Text,, Street 2: 
Gui, Add, Text,, City: 
Gui, Add, Text,, State: 
Gui, Add, Text,, Zip: 
Gui, Add, Text,, Phone: 
Gui, Add, Edit, vFirstName ym 
Gui, Add, Edit, vMiddleName 
Gui, Add, Edit, vLastName 
Gui, Add, Edit, vStreet1 
Gui, Add, Edit, vStreet2 
Gui, Add, Edit, vCity 
Gui, Add, Edit, vState 
Gui, Add, Edit, vZip 
Gui, Add, Edit, vPhone 
Gui, Add, Button, x124 y260 w54 h26 default , OK 
Gui, Add, Button, x40 y260 w54 h26 , Cancel 
; Generated using SmartGUI Creator 4.0 
Gui, Show 
return 

ButtonCancel: 
ExitApp 
return 

GuiClose: 
ButtonOK: 
Gui, Submit ; Save the input from the user to each control's associated variable. 
MsgBox %vFirstName% %vMiddleName% %vLastName% 
ExitApp 

回答

0

看起來您在MsgBox中指的是您的變量不正確。

在您的GUI界面上,您正確使用v前綴。但是,該前綴不包含在變量名稱中。你Msgbox線應該是這樣的:

MsgBox %FirstName% %MiddleName% %LastName% 

要解決在將來,你可以雙擊在托盤您的AHK圖標,進入View -> Variables and contents或運行Listvars命令。