3
I have this ListBox
.
When loaded he wears one txt file
being like this:
private void frmOrdemServico_Load(object sender, EventArgs e)
{
string[] d = File.ReadAllLines(@"C:\\Users\\willian\\Downloads\\dbProdutos.txt");
foreach (var line in d)
{
string[] produtos = line.Split(' ');
lbProdutos.Items.Add(produtos[0]);
}
}
I have 2 problems:
first The names of the products are not complete because where there is space is cut: example: Liquid soap, stay: Soap only. [solved]
2nd I do not know how to bring in another column inside the Listbox the values of the products, because I intend to use them. [solved]
My file txt
is in this shape:
disregard data only call structure
Note: I read a little on the internet about Listview but not I was able to implement it because I couldn’t pass data on one side to another etc. And bring the two columns finally..
It seems your field separator is the
-
, soon makeSplit
for-
would already solve the problem of cutting words– Isac
Truth, solved this problem, I didn’t even notice it, I was giving space, because I thought he took the space of words..
– WSS