How to display listbox items in array format in C#

this is my list box which contain values and i want that values to be in
int array
int array = new int[…];
and printing in text box (multiline)

            int[] k1 = new int[listBox1.Items.Count];

            for (int i = 0; i < listBox1.Items.Count; i++)
                k1[i] = (int)listBox1.Items[i];
                textBox2.Text = k1[i].ToString();


not working i implemented it pls help anyone


How is the data being added to the listbox? What format is it in? I cannot really figure out what is going on without that step


This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.