First of all; I cannot use list. It has to be a array for school purposes.
I have a string[] Brands = new string[10]; Four elements of this array are already filled when the form is initialized. The empty elements can be filled by adding textbox value to array with btnclick I'm displaying the filled elements in a listbox. The problem is that the listbox displays it like this:
Kawasaki
Yamaha
Harley
Suzuki
It needs to be displayed like this:
Kawasaki Yamaha Harley Suzuki
(when i click the buttun it needs to the already existing elementsd like this)
Kawasaki Yamaha Harley Suzuki (the added value1)
Another btnclick:
Kawasaki Yamaha Harley Suzuki (the added value1) (the added value2)
I know I need to use a for loop in my btnclik but I don't know how. This is what I currently have in my btnclick event:
if (brandNr >= 10)
return;
Brands[brandNr++] = textBoxBrand.Text;
listBoxMotorcycles.DataSource = null;
listBoxMotorcycles.DataSource = Brands;