我有一个 AutoHotkey 脚本,需要从用户读取多行员工数据。
InputBox, userInput, Employee Records, Please enter employee records. (One per line)
Unfortunately, an InputBox https://autohotkey.com/docs/commands/InputBox.htm only allows users to enter a single line of text. Trying to add newlines with Enter will instead submit whatever data has been entered.
如何在 AutoHotkey 脚本中获取多行用户输入?
这实现了通用的多行输入功能
F3::MsgBox % MultiLineInput( "Employee Records", "Please enter employee records (One per line):" )
MultiLineInput(title, prompt)
{
static input
input := ""
Gui, Add, Text,, %prompt%
Gui, Add, Edit, w400 h60 vinput
Gui, Add, Button, gokay_pressed, Okay
Gui, Add, Button, cancel X+8 YP+0, Cancel
Gui, Show, Center autosize, %title%
WinWaitClose %title%
return input
okay_pressed:
Gui Submit
Gui Destroy
return
GuiClose:
GuiEscape:
ButtonCancel:
Gui, Destroy
return
}
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)