Multi Line String to ListBox

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
MusoCity
Posts: 95
Joined: 24 Mar 2018, 20:45

Multi Line String to ListBox

31 Aug 2023, 09:24

I have a multi line sting I want to add the lines to rows but it all going on the one row at the moment

GuiControl,,MyListBoxVariable,|%string3%
just me
Posts: 9574
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: Multi Line String to ListBox

31 Aug 2023, 09:39

You need to replace the line breaks with a pipe | (the default delimiter):

Code: Select all

GuiControl,,MyListBoxVariable, % "|" . StrReplace(StrReplace(string3, "`r`n", "`n"), "`n", "|")
or add the lines one by one:

Code: Select all

GuiControl, , LB, | ; clear the listbox
Loop, Parse, string3, `n, `r
   GuiControl, , LB, %A_LoopField%

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: MrHue, Rohwedder, Rxbie, songdg and 340 guests