title: Retrieving CheckedListBox Selected Items as Dictionary
body: <p>I have a checkedlistbox on my form which I populate using a Dictionary. It works fine when I populate the box but when I try to retrieve the selected object I can't figure out how to do it as a dictionary.</p>
  
  <p>My code to populate it:</p>
  
  <pre><code>reader = widgetSelection.ExecuteReader();
  while (reader.Read())
  {
   widgets.Add(reader.GetInt32(0), reader.GetString(reader.GetOrdinal("name")));
  }
  
  foreach (var widget in widgets)
  {
      chbWidgets.Items.Add(widget);
  }
  </code></pre>
  
  <p>It populates perfectly but any attempt to do a foreach or anything out of it will only come back as object and I can't figure out the proper way to cast the items. Any help would be great.</p>