title: I need my for loop to continue past the first index of each array but I don't know how
body: <pre><code>#pragma once
  
  namespace StudentDataSearch {
  
      using namespace System;
      using namespace System::ComponentModel;
      using namespace System::Collections;
      using namespace System::Windows::Forms;
      using namespace System::Data;
      using namespace System::Drawing;
  
      /// &lt;summary&gt;
      /// Summary for Form1
      /// &lt;/summary&gt;
      public ref class Form1 : public System::Windows::Forms::Form
      {
      public:
          Form1(void)
          {
              InitializeComponent();
              //
              //TODO: Add the constructor code here
              //
          }
  
      protected:
          /// &lt;summary&gt;
          /// Clean up any resources being used.
          /// &lt;/summary&gt;
          ~Form1()
          {
              if (components)
              {
                  delete components;
              }
          }
      private: System::Windows::Forms::Button^  btnSearch;
      protected: 
  
      protected: 
  
      private: System::Windows::Forms::Label^  Course_ID1;
      protected: 
  
      private: System::Windows::Forms::TextBox^  txtTargetID;
  
      private: System::Windows::Forms::GroupBox^  groupBox1;
      private: System::Windows::Forms::TextBox^  txtSeats;
      private: System::Windows::Forms::Label^  Seats;
      private: System::Windows::Forms::TextBox^  txtID;
      private: System::Windows::Forms::Label^  Course_ID;
      private: System::Windows::Forms::TextBox^  txtName;
      private: System::Windows::Forms::Label^  Course_Names2;
      private: System::Windows::Forms::Button^  btnSearchName;
  
  
      private:
          /// &lt;summary&gt;
          /// Required designer variable.
          /// &lt;/summary&gt;
          System::ComponentModel::Container ^components;
  
  #pragma region Windows Form Designer generated code
          /// &lt;summary&gt;
          /// Required method for Designer support - do not modify
          /// the contents of this method with the code editor.
          /// &lt;/summary&gt;
          void InitializeComponent(void)
          {
              this-&gt;btnSearch = (gcnew System::Windows::Forms::Button());
              this-&gt;Course_ID1 = (gcnew System::Windows::Forms::Label());
              this-&gt;txtTargetID = (gcnew System::Windows::Forms::TextBox());
              this-&gt;groupBox1 = (gcnew System::Windows::Forms::GroupBox());
              this-&gt;txtSeats = (gcnew System::Windows::Forms::TextBox());
              this-&gt;Seats = (gcnew System::Windows::Forms::Label());
              this-&gt;txtID = (gcnew System::Windows::Forms::TextBox());
              this-&gt;Course_ID = (gcnew System::Windows::Forms::Label());
              this-&gt;txtName = (gcnew System::Windows::Forms::TextBox());
              this-&gt;Course_Names2 = (gcnew System::Windows::Forms::Label());
              this-&gt;btnSearchName = (gcnew System::Windows::Forms::Button());
              this-&gt;groupBox1-&gt;SuspendLayout();
              this-&gt;SuspendLayout();
              // 
              // btnSearch
              // 
              this-&gt;btnSearch-&gt;Location = System::Drawing::Point(12, 12);
              this-&gt;btnSearch-&gt;Name = L"btnSearch";
              this-&gt;btnSearch-&gt;Size = System::Drawing::Size(144, 39);
              this-&gt;btnSearch-&gt;TabIndex = 0;
              this-&gt;btnSearch-&gt;Text = L"Search by Course ID";
              this-&gt;btnSearch-&gt;UseVisualStyleBackColor = true;
              this-&gt;btnSearch-&gt;Click += gcnew System::EventHandler(this, &amp;Form1::btnSearch_Click);
              // 
              // Course_ID1
              // 
              this-&gt;Course_ID1-&gt;AutoSize = true;
              this-&gt;Course_ID1-&gt;Location = System::Drawing::Point(317, 28);
              this-&gt;Course_ID1-&gt;Name = L"Course_ID1";
              this-&gt;Course_ID1-&gt;Size = System::Drawing::Size(54, 13);
              this-&gt;Course_ID1-&gt;TabIndex = 1;
              this-&gt;Course_ID1-&gt;Text = L"Course ID";
              // 
              // txtTargetID
              // 
              this-&gt;txtTargetID-&gt;Location = System::Drawing::Point(377, 25);
              this-&gt;txtTargetID-&gt;Name = L"txtTargetID";
              this-&gt;txtTargetID-&gt;Size = System::Drawing::Size(100, 20);
              this-&gt;txtTargetID-&gt;TabIndex = 2;
              // 
              // groupBox1
              // 
              this-&gt;groupBox1-&gt;Controls-&gt;Add(this-&gt;txtSeats);
              this-&gt;groupBox1-&gt;Controls-&gt;Add(this-&gt;Seats);
              this-&gt;groupBox1-&gt;Controls-&gt;Add(this-&gt;txtID);
              this-&gt;groupBox1-&gt;Controls-&gt;Add(this-&gt;Course_ID);
              this-&gt;groupBox1-&gt;Controls-&gt;Add(this-&gt;txtName);
              this-&gt;groupBox1-&gt;Controls-&gt;Add(this-&gt;Course_Names2);
              this-&gt;groupBox1-&gt;Location = System::Drawing::Point(12, 145);
              this-&gt;groupBox1-&gt;Name = L"groupBox1";
              this-&gt;groupBox1-&gt;Size = System::Drawing::Size(465, 140);
              this-&gt;groupBox1-&gt;TabIndex = 3;
              this-&gt;groupBox1-&gt;TabStop = false;
              this-&gt;groupBox1-&gt;Text = L"Search Results";
              // 
              // txtSeats
              // 
              this-&gt;txtSeats-&gt;Location = System::Drawing::Point(301, 81);
              this-&gt;txtSeats-&gt;Name = L"txtSeats";
              this-&gt;txtSeats-&gt;Size = System::Drawing::Size(100, 20);
              this-&gt;txtSeats-&gt;TabIndex = 5;
              // 
              // Seats
              // 
              this-&gt;Seats-&gt;AutoSize = true;
              this-&gt;Seats-&gt;Location = System::Drawing::Point(298, 65);
              this-&gt;Seats-&gt;Name = L"Seats";
              this-&gt;Seats-&gt;Size = System::Drawing::Size(34, 13);
              this-&gt;Seats-&gt;TabIndex = 4;
              this-&gt;Seats-&gt;Text = L"Seats";
              // 
              // txtID
              // 
              this-&gt;txtID-&gt;Location = System::Drawing::Point(204, 81);
              this-&gt;txtID-&gt;Name = L"txtID";
              this-&gt;txtID-&gt;Size = System::Drawing::Size(91, 20);
              this-&gt;txtID-&gt;TabIndex = 3;
              // 
              // Course_ID
              // 
              this-&gt;Course_ID-&gt;AutoSize = true;
              this-&gt;Course_ID-&gt;Location = System::Drawing::Point(206, 65);
              this-&gt;Course_ID-&gt;Name = L"Course_ID";
              this-&gt;Course_ID-&gt;Size = System::Drawing::Size(54, 13);
              this-&gt;Course_ID-&gt;TabIndex = 2;
              this-&gt;Course_ID-&gt;Text = L"Course ID";
              // 
              // txtName
              // 
              this-&gt;txtName-&gt;Location = System::Drawing::Point(25, 81);
              this-&gt;txtName-&gt;Name = L"txtName";
              this-&gt;txtName-&gt;Size = System::Drawing::Size(173, 20);
              this-&gt;txtName-&gt;TabIndex = 1;
              // 
              // Course_Names2
              // 
              this-&gt;Course_Names2-&gt;AutoSize = true;
              this-&gt;Course_Names2-&gt;Location = System::Drawing::Point(22, 65);
              this-&gt;Course_Names2-&gt;Name = L"Course_Names2";
              this-&gt;Course_Names2-&gt;Size = System::Drawing::Size(71, 13);
              this-&gt;Course_Names2-&gt;TabIndex = 0;
              this-&gt;Course_Names2-&gt;Text = L"Course Name";
              // 
              // btnSearchName
              // 
              this-&gt;btnSearchName-&gt;Location = System::Drawing::Point(12, 57);
              this-&gt;btnSearchName-&gt;Name = L"btnSearchName";
              this-&gt;btnSearchName-&gt;Size = System::Drawing::Size(144, 39);
              this-&gt;btnSearchName-&gt;TabIndex = 4;
              this-&gt;btnSearchName-&gt;Text = L"Search by Course Name";
              this-&gt;btnSearchName-&gt;UseVisualStyleBackColor = true;
              // 
              // Form1
              // 
              this-&gt;AutoScaleDimensions = System::Drawing::SizeF(6, 13);
              this-&gt;AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
              this-&gt;ClientSize = System::Drawing::Size(519, 297);
              this-&gt;Controls-&gt;Add(this-&gt;btnSearchName);
              this-&gt;Controls-&gt;Add(this-&gt;groupBox1);
              this-&gt;Controls-&gt;Add(this-&gt;txtTargetID);
              this-&gt;Controls-&gt;Add(this-&gt;Course_ID1);
              this-&gt;Controls-&gt;Add(this-&gt;btnSearch);
              this-&gt;Name = L"Form1";
              this-&gt;Text = L"Student Data Search";
              this-&gt;Load += gcnew System::EventHandler(this, &amp;Form1::Form1_Load);
              this-&gt;groupBox1-&gt;ResumeLayout(false);
              this-&gt;groupBox1-&gt;PerformLayout();
              this-&gt;ResumeLayout(false);
              this-&gt;PerformLayout();
  
          }
  #pragma endregion
          private: array&lt;String^&gt;^ CourseArr;
          private: array&lt;String^&gt;^ CourseID;
          private: array&lt;Int32&gt;^ SeatsArr;
          private: String^ strTarget;
          private: String^ strOut;
  
      private: System::Void Form1_Load(System::Object^  sender, System::EventArgs^  e) {
                   // Course Names
                   CourseArr = gcnew array&lt;String^&gt;(9);
                   CourseArr-&gt;SetValue("Computer Sci 1511", 0);
                   CourseArr-&gt;SetValue("Computer Sci 1521", 1);
                   CourseArr-&gt;SetValue("Composition 1120", 2);
                   CourseArr-&gt;SetValue("Math 1296", 3);
                   CourseArr-&gt;SetValue("Physics 1120", 4);
                   CourseArr-&gt;SetValue("Biology 1100", 5);
                   CourseArr-&gt;SetValue("Chemistry 1100", 6);
                   CourseArr-&gt;SetValue("Anthropology 1210", 7);
                   CourseArr-&gt;SetValue("Economics 1000", 8);
  
  
                   // Course ID
                   CourseID = gcnew array&lt;String^&gt;(9);
                   CourseID-&gt;SetValue("123", 0);
                   CourseID-&gt;SetValue("124", 1);
                   CourseID-&gt;SetValue("135", 2);
                   CourseID-&gt;SetValue("145", 3);
                   CourseID-&gt;SetValue("146", 4);
                   CourseID-&gt;SetValue("149", 5);
                   CourseID-&gt;SetValue("155", 6);
                   CourseID-&gt;SetValue("162", 7);
                   CourseID-&gt;SetValue("175", 8);
  
  
                   //Seats Avaliable
                   SeatsArr = gcnew array&lt;Int32&gt;(9);
                   SeatsArr-&gt;SetValue(0, 0);
                   SeatsArr-&gt;SetValue(25, 1);
                   SeatsArr-&gt;SetValue(14, 2);
                   SeatsArr-&gt;SetValue(5, 3);
                   SeatsArr-&gt;SetValue(0, 4);
                   SeatsArr-&gt;SetValue(20, 5);
                   SeatsArr-&gt;SetValue(17, 6);
                   SeatsArr-&gt;SetValue(0, 7);
                   SeatsArr-&gt;SetValue(12, 8);
  
  
               }
  
  
  
  
  private: System::Void btnSearch_Click(System::Object^  sender, System::EventArgs^  e) {
               int course, small, large;
               int id;
               int seats;
               small = 0;
               large = 9;
               strTarget = txtTargetID-&gt;Text;
  
               if (strTarget == "")
               {
                   MessageBox::Show("Fill in empty fields");
                   return;
              }
  help needed here ----------------------------------------------------------
  </code></pre>
  
  <p>I need to loop through my arrays and used their values (listed above) and put the selected values into certain text boxes but I am unsure if I need another for loop or what please help and all help is appreciated.</p>
  
  <pre><code>             for (int small = 0; small &lt;= large; small++)
               {
                   for (int course = 0; course &lt; CourseID-&gt;Length; course++)
                   {
                   txtName-&gt;Text = CourseArr[0];
                   txtID-&gt;Text = CourseID[0];
                   txtSeats-&gt;Text = SeatsArr[0].ToString();
                   }
              }
  </code></pre>