title: c# add tag to ListBox item
body: <p>In my application there is a listbox which is being filled dynamically.</p>
  
  <p>Each item needs to have a click event, so it will open a component belonging by this item.</p>
  
  <p>Thereby I need to add a tag on each item, so I can get this tag within the event method.</p>
  
  <p>Listbox:</p>
  
  <pre><code>var lb_Volunteers_From_Question = new ListBox();
  foreach (var volunteer in volunteers)
  {
      lb_Volunteers_From_Question.Items.Add(volunteer.Name);
      {
          // set tag
          Tag = volunteer;
      };
  
      // set event
      lb_Volunteers_From_Question.Click += new EventHandler(ShowVolunteerProfile);
  }
  
  // listbox settings
  </code></pre>
  
  <p>Event method</p>
  
  <pre><code>public void ShowVolunteerProfile(object sender, EventArgs e)
  {
      // get volunteer out of tag
      var item = sender as ListBox;
      var tagQuestionDetail = (TagQuestionDetail)item.Tag;
  
  
      // Show volunteer profile info
      // code                     
  }
  </code></pre>
  
  <p>But this is not working out for me. Is there a way? </p>