title: Replace Images at the Top of ImageList and ListView
body: <p>I will load say 10 images in imagelist and list View. then later, I want to replace the first 5 (top 5 in the list). But The new images are always added at the bottom of the list in the display.</p>
  
  <pre><code>    Initialize_ListView()
      for (int i = 0; i &lt; 10; i++) 
          {
             AddItemTo_ListView(i);
          }
  
  Now I later use this code to replace the top 5
     for (int i = 0; i &lt; 5; i++) 
          {
             ImageAndThumb imgObj = new ImageAndThumb(output);
             Replace(imgObj , i)
          }
  
  
     private void Initialize_ListView()
      {
          this.imageList1.Images.Clear();
          this.listView1.Clear();
          this.listView1.View = View.SmallIcon;
          this.imageList1.ImageSize = new Size(75, 80);
          this.listView1.SmallImageList = this.imageList1;
      }
  
      private void AddItemTo_ListView(int index)
      {
          ImageAndThumb imgObj = new ImageAndThumb(output);
          ImageAndThumbLst.Add(imgObj);
  
           this.imageList1.Images.Add(ImageAndThumbLst[index].Thumb);
  
          ListViewItem item = new ListViewItem();
          item.ImageIndex = index;
          this.listView1.Items.Add(item);
      }
  
  
      private void Replace(ImageAndThumb obj, int indx)
      {
          ImageAndThumbLst[indx] = obj;          
          this.imageList1.Images[indx] = ImageAndThumbLst[indx].Thumb;
          ListViewItem item = new ListViewItem();
          item.ImageIndex = indx;           
          this.listView1.Items[indx]=item;      
      }
  </code></pre>