如何动态更新自动热键GUI元素

问题描述

我已经使用AHK创建了GUI。我将ID和说明存储为键值对。当用户用关联数组中存储的相应desc输入ID时,我想更新Desc。如何动态更新GUI?

^h::

oKeys := []
ovalues := []
oArray := {}


if (WinExist("ahk_id " hwndgui)) {
    Gui,Destroy
    return
}

gui,add,text,Type:
Gui,Add,DropDownList,vType,TSO|pax|DVI 
gui,ID:
Gui,Edit,vId
gui,Partial|Complete:
Gui,vPartial,Partial||Complete
gui,Left-Behind:
Gui,vLeft,False||True
gui,XFR-Type:
Gui,vXFR,Standard||Contact|Theft
gui,DESC:
Gui,vDesc,oArray[(TypeId)]
Gui,Button,Default gOK,OK

Gui,Show,Hide

Gui,+LastFound
hwndgui:=WinExist()
OK:
Gui,Submit

oKeys.Push((TypeId))
ovalues.Push((Desc))
Loop,% oKeys.Length()
oArray[oKeys[A_Index]] := ovalues[A_Index]
    

if WinExist("labelImg")
    WinActivate  ; Uses the last found window.
    Send,^a
    Send,%Type%_%Id%_%Partial%_%Desc%
    for vKey,vValue in oArray
    vOutput .= vKey " " vValue "`r`n"
    MsgBox,% vOutput
    
Gui,Show
return

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)