private: System::Void btnView_Click(System::Object^ sender, System::EventArgs^ e) /*---create an array to hold names of 6 myFriends. Arrays start at zero just like list boxes so the first item in the array starts at element 0. The members of an array are called elements and the index number that defines each one is called a subscript. */ { //---OPTION 1:create a new array that holds 6 strings. Notice there is a ^ for the String type // and a ^ for the array that goes after the <>. Arrays are reference types and stored in the heap. array^ myFriends = gcnew array(6); int x=0; myFriends[0] = "Charles"; myFriends[1] = "Sandi"; myFriends[2] = "Bruce"; myFriends[3] = "Tim"; myFriends[4] = "Bill"; myFriends[5] = "Kathy"; //*********************************************************** //---OPTION 2: or you can preload it this way. Notice you do not use gcnew or tell it the // number of elements. This is very common so learn this!! //array^ myFriends = { "Charles", "Sandi" , "Bruce", "Tim", "Bill", "Kathy"}; //*********************************************************** //---do they want it sorted? if(rdoSort->Checked) Array::Sort(myFriends); //this uses the Array Class and it's Sort method. You tell it // the name of the array to sort! lstmyFriends->Items->Clear(); //---YOU NEED TO KNOW HOW TO DO BOTH OF THESE OPTIONS //---OPTION 1: now cycle through the array and add each one to the listbox for (int x=0; x< myFriends->Length; x++) lstmyFriends->Items->Add(myFriends[x]); //---OPTION 2: or use a for each loop //for each(String^ myItem in myFriends) // lstmyFriends->Items->Add(myItem); }