autohotkey - 如何动态更新自动热键 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, add, text,, ID:
Gui, Add, Edit, vId
gui, add, text,, Partial|Complete:
Gui, Add, DropDownList,vPartial, Partial||Complete
gui, add, text,, Left-Behind:
Gui, Add, DropDownList,vLeft, False||True
gui, add, text,, XFR-Type:
Gui, Add, DropDownList,vXFR, Standard||Contact|Theft
gui, add, text,, DESC:
Gui, Add, Edit, vDesc , oArray[(TypeId)]
Gui, Add, 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
解决方案
推荐阅读
- javascript - 如何在vue中清除模态表单内的值
- r - tidymodels 列中发现的新级别
- pyspark - 如何从 Pyspark 中的另一列中获取包含值列表的列
- wayland - 非 XDG Wayland 应用程序的示例?
- character - 如何选择出现在多个不连续行中的同一组字符,然后将这些标记的整个行复制到新的记事本中?
- swift - How can I be sure that I am accessing the correct value to use in Swift
- excel - 使用 ADO 和 ACE 提供程序为 INSERT 组合多个 UNION
- javascript - 创建将来自两个文件的数据与公共列相结合的地图 - 但数据不一对一匹配
- jdbc - 从雪花中的所有可用数据库中获取模式
- c# - 如何使用剃须刀组件在 asp.net 核心 Web 应用程序中管理文件(上传/删除)