Page 1 of 1

Can I set the items column width for a listbox list

Posted: Wednesday 30th January 2019 10:41am
by te777
I have a listbox on my main form that I populate from a text file. No problem there. And I set the listbox width to accommodate the the maximum width of a list item. But when I run in debug the items column width is truncated to 15 characters and the remaining characters for that item is listed on next line of the list. Is there a way to set the list width so that each item in the list is not truncated in this way? Thanks in advance for any replies. The listbox is set to vertical scrollbar with single mode.

Re: Can I set the items column width for a listbox list

Posted: Wednesday 30th January 2019 10:58am
by te777
I fixed it. I changed the following line:

VPN_Names.List = Split(File.Load(FileName1), "\\n")

to

VPN_Names.List = Split(File.Load(FileName1), gb.NewLine)

Re: Can I set the items column width for a listbox list

Posted: Wednesday 30th January 2019 12:44pm
by cogier
The problem with your first code was the '\\n', which causes all sorts of interesting issues. If you had used '\n' it would have worked OK.