title: Transferring array of strings to checked list box and list box
body: <p>I have one checked list box and according to the selected items I want to transfer an array of strings to a second checked list box and also to a list box.So basically lets say I picked "Tumu" from the first checked list box,I want the string tumu[i] to be written in both the second checked list box and the list box.The same would go for "Teknik" using the teknik[i],and Idari using the idari[i] array.The problem is when I assigned the string to the corresponding checked list box,when running the program would display teknik[i] when I would click "Tumu",but I want the tumu[i] array to be displayed.Also after I would uncheck and check the results would change into another string array...basically the program is acting up.Also I want the results in the list box to be deleted and the check boxes to be unchecked in the second list box when the user unchecks an item from the first checked list box.If anyone has any ideas about what the problem might be it would be greatly appreciated :) I have attatched a picture and also the code.</p>
  
  <p>private void chklstbx_bolum_ItemCheck(object sender, ItemCheckEventArgs e)
          {  //the first check box list</p>
  
  <pre><code>        string[] tumu = { "Jane", "Tom", "Danny", "John", "Jacyln", "Lily", "Lale" };
          string[] idari = { "Jane", "Tom", "Danny" };
          string[] teknik = {  "John", "Jacyln", "Lily", "Lale"};
  
  
  
  
  
  
          if (chklstbx_bolum.GetItemChecked(0) == false)
  
          {    //if the first box is checked then do this
  
  
              chklstbx_sonuc.Items.Clear();
              for (int i = 0; i &lt; teknik.Length; i++)
              {
  
                  chklstbx_sonuc.Items.Add(teknik[i]);
                  lstbx_sonuc.Items.Add(teknik[i]);
                  chklstbx_sonuc.SetItemChecked(i, true);
  
              }
  
  
          }
  
         }
  
  
              if (chklstbx_bolum.GetItemChecked(0) == true) 
  
              {//when the first item is unchecked then items in the list box will be cleared and the items in the second list box will be all unchecked.
  
                  lstbx_sonuc.Items.Clear();
                  for (int i = 0; i &lt; chklstbx_sonuc.Items.Count; i++)
                  {
                      chklstbx_sonuc.SetItemChecked(i, false);
                  }
  
              }
  
  
          else if (chklstbx_bolum.GetItemChecked(1) == false)
          {
              chklstbx_sonuc.Items.Clear();
  
  
              for (int i = 0; i &lt; idari.Length; i++)
              {
  
                  chklstbx_sonuc.Items.Add(idari[i]);
                  lstbx_sonuc.Items.Add(idari[i]);
  
                  chklstbx_sonuc.SetItemChecked(i, true);
  
              }
  
  
  
          }
  
             if (chklstbx_bolum.GetItemChecked(1) == true) 
  
              {//when the second item in the first checked list box is unchecked then items in the list box will be cleared and the items in the second list box will be all unchecked.
  
                  lstbx_sonuc.Items.Clear();
                  for (int i = 0; i &lt; chklstbx_sonuc.Items.Count; i++)
                  {
                      chklstbx_sonuc.SetItemChecked(i, false);
                  }
  
              }
  
  
          else if (chklstbx_bolum.GetItemChecked(2) == false)
          {
  
  
              chklstbx_sonuc.Items.Clear();
  
              for (int i = 0; i &lt; tumu.Length; i++)
              {
  
                  chklstbx_sonuc.Items.Add(tumu[i]);
                  lstbx_sonuc.Items.Add(tumu[i]);
                  chklstbx_sonuc.SetItemChecked(i, true);
  
  
  
              }
          }
  
  
          if (chklstbx_bolum.GetItemChecked(2) == true) 
              {  //when the third item in the first checked list box is unchecked then items in the list box will be cleared and the items in the second list box will be all unchecked.
  
                  lstbx_sonuc.Items.Clear();
                  for (int i = 0; i &lt; chklstbx_sonuc.Items.Count; i++)
                  {
                      chklstbx_sonuc.SetItemChecked(i, false);
                  }
  
              }
      }
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/rUWch.png" alt="enter image description here"></p>