微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

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

如何解决如何动态更新自动热键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 举报,一经查实,本站将立刻删除。