Form1 listbox to Form2 Textbox. Only getting the very last item from form1 into form2 textbox

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
Form1 has a listbox with several entries. I need to transfer these entries to TextBox on form 2

<pre class="prettyprint <span class="x_x_Apple-tab-span" style="white-space:pre Convertor^ form2 = gcnew Convertor();
<span class="x_x_Apple-tab-span" style="white-space:pre for (int i = 0; i < listBox1->Items->Count; i++){
<span class="x_x_Apple-tab-span" style="white-space:pre String^ temp = listBox1->Items->ToString();
<span class="x_x_Apple-tab-span" style="white-space:pre form2->textBox1->Text = temp; <span class="x_x_Apple-tab-span" style="white-space:pre } <span class="x_x_Apple-tab-span" style="white-space:pre form2->ShowDialog(); [/code]
If I have a list like

This
Is
My
List

Then that code only adds "List" to the textbox

Please help


View the full article
 
Back
Top