我正在尝试解析循环,除非我无法删除列表中的第一项,否则这样做很有效。可能与反击有关。无法搞清楚了!
更新 - 确定,需要复制没有反引号的StringReplace行,以便获取列表中的第一项。
Gui, Add, ListBox, 8 x26 y37 w100 h100 vColorChoice, Red|Green|Blue|Black|White
Gui +Delimiter`n
Gui, Add, Button, Default, Delete
Gui, show
return
ButtonDelete:
Gui, Submit, NoHide
ControlGet, ListBoxContents, List,, ListBox1
StringReplace, ListBoxContents, ListBoxContents, |, `n, All
msgbox %ColorChoice% ; ColorChoice here contains the files selected to delete
Loop, Parse, ColorChoice, `n
{
StringReplace, ListBoxContents, ListBoxContents, %A_LoopField%`n
StringReplace, ListBoxContents, ListBoxContents, %A_LoopField%
msgbox %ListBoxContents%
}
GuiControl,, ColorChoice, `n%ListBoxContents%
return
GuiClose:
ExitApp