Can I set the items column width for a listbox list

Post your Gambas programming questions here.
Post Reply
te777
Posts: 4
Joined: Thursday 17th January 2019 11:39am

Can I set the items column width for a listbox list

Post 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.
te777
Posts: 4
Joined: Thursday 17th January 2019 11:39am

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

Post 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)
User avatar
cogier
Site Admin
Posts: 1118
Joined: Wednesday 21st September 2016 2:22pm
Location: Guernsey, Channel Islands

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

Post 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.
Post Reply