AutoHotKey如何在此处将下拉列表连接到我的编辑框

时间:2016-01-09 11:44:33

标签: autohotkey

我已经尝试了几天来解决这个问题,我很累,需要帮助,我希望下拉列表中的每个数字都有自己的负载,例如DDL 1应该独立加载所有编辑框和DDL2等等。每个DDL应该有自己的数据加载..这是我的代码

`Gui 1:Font, S8 CDefault, Tahoma
Gui, Color, 008AB8
Gui 1:Show, x131 y91 h379 w479, Rotation Helper

Gui, Add, DropDownList,x76 y27 w50 h20 r10 gLoad, 1|2|3|4|5|6|7|8|9|10|11
Gui, Add, Edit, x76 y57 w50 h20 vMyEdit,Hotkey
Gui, Add, Edit, x76 y87 w50 h20 vMyEdit2,Color
Gui, Add, Edit, x76 y117 w50 h20 vX1,X1
Gui, Add, Edit, x76 y147 w50 h20 vY1,Y1
Gui, Add, Edit, x76 y177 w50 h20 vX2,X2
Gui, Add, Edit, x76 y207 w50 h20 vY2,Y2

Gui, Add,  Button, x366 y337 w90 h30 gLoad, Load
Gui, Add, Button, x256 y337 w100 h30 gSave, Save
Gui, Add, GroupBox, x6 y7 w450 h250 , Settings

Save:
Gui, Submit, NoHide

IniWrite,%MyEdit%, %a_Workingdir%\Iniread.ini, List, List1
IniWrite,%MyEdit2%, %a_Workingdir%\Iniread.ini, List, List2
IniWrite,%X1%, %a_Workingdir%\Iniread.ini, List, List3
IniWrite,%Y1%, %a_Workingdir%\Iniread.ini, List, List4
IniWrite,%X2%, %a_Workingdir%\Iniread.ini, List, List5
IniWrite,%Y1%, %a_Workingdir%\Iniread.ini, List, List6

return

Load:
GuiControl,, MyEdit, %Read% 
GuiControl,, MyEdit2, %Read2%
GuiControl,, X1, %newX1% 
GuiControl,, Y1, %newY1%
GuiControl,, X2, %newX2%
GuiControl,, Y2, %newY2%


Iniread, Read, %a_workingdir%\Iniread.ini, List, List1
Iniread,Read2, %a_Workingdir%\Iniread.ini, List, List2
Iniread,newX1, %a_Workingdir%\Iniread.ini, List, List3
Iniread,newY1, %a_Workingdir%\Iniread.ini, List, List4
Iniread,newX2, %a_Workingdir%\Iniread.ini, List, List5
Iniread,newY2, %a_Workingdir%\Iniread.ini, List, List6





Return`

1 个答案:

答案 0 :(得分:1)

将DDL值作为参数添加到ini,submit DDL值,并在load中设置>之前读取数据

Gui, Color, 008AB8
Gui 1:Show, x131 y91 h379 w479, Rotation Helper

Gui, Add, DropDownList,x76 y27 w50 h20 r10 gLoad vDDL, 1|2|3|4|5|6|7|8|9|10|11
Gui, Add, Edit, x76 y57 w50 h20 vMyEdit,Hotkey
Gui, Add, Edit, x76 y87 w50 h20 vMyEdit2,Color
Gui, Add, Edit, x76 y117 w50 h20 vX1,X1
Gui, Add, Edit, x76 y147 w50 h20 vY1,Y1
Gui, Add, Edit, x76 y177 w50 h20 vX2,X2
Gui, Add, Edit, x76 y207 w50 h20 vY2,Y2

Gui, Add,  Button, x366 y337 w90 h30 gLoad, Load
Gui, Add, Button, x256 y337 w100 h30 gSave, Save
Gui, Add, GroupBox, x6 y7 w450 h250 , Settings

Save:
Gui, Submit, NoHide

IniWrite,%MyEdit%, %a_Workingdir%\Iniread.ini, List%DDL%, List1
IniWrite,%MyEdit2%, %a_Workingdir%\Iniread.ini, List%DDL%, List2
IniWrite,%X1%, %a_Workingdir%\Iniread.ini, List%DDL%, List3
IniWrite,%Y1%, %a_Workingdir%\Iniread.ini, List%DDL%, List4
IniWrite,%X2%, %a_Workingdir%\Iniread.ini, List%DDL%, List5
IniWrite,%Y1%, %a_Workingdir%\Iniread.ini, List%DDL%, List6

return

Load:
Gui, Submit, NoHide

Iniread, Read, %a_workingdir%\Iniread.ini, List%DDL%, List1
Iniread,Read2, %a_Workingdir%\Iniread.ini, List%DDL%, List2
Iniread,newX1, %a_Workingdir%\Iniread.ini, List%DDL%, List3
Iniread,newY1, %a_Workingdir%\Iniread.ini, List%DDL%, List4
Iniread,newX2, %a_Workingdir%\Iniread.ini, List%DDL%, List5
Iniread,newY2, %a_Workingdir%\Iniread.ini, List%DDL%, List6

GuiControl,, MyEdit, %Read%
GuiControl,, MyEdit2, %Read2%
GuiControl,, X1, %newX1%
GuiControl,, Y1, %newY1%
GuiControl,, X2, %newX2%
GuiControl,, Y2, %newY2%