title: Switch statement inside a foreach loop - not getting expected results
body: <p>So I am trying to loop though items that are in a listbox in my application. The list box will allow you to select multiple items to which I have a method tied to each item in the listbox. I have a counter variable incremented each time the loop works.When I use the foreach loop with the switch statement below, it does the first item correct, but then loops through the same item again. I know I am missing something as it is supposed to go to the next item in the listbox and not the same item.</p>
  
  <pre><code>      string reportname = lstbxReports.SelectedValue.ToString();
        int i = 0;
              foreach (var report in reportname)
              {
                  switch (reportname)
                  {
                      case "Overview":
                          {
                              if (i &lt; 1)
                              {
                                  PrintOverview(filename);
                              }
                              else if (i &gt;= 1)
                              {
                                  PrintOverviewAppend(filename);
                              }
                              break;
                          }
                      case "Sources":
                          {
                              if (i &lt; 1)
                              {
                               PrintSource(filename);
                              }
                              else if (i &gt;= 1) 
                              {
                               PrintSourceAppend(filename);
                              }
                              break;
                          }
                         }
                        i++
  </code></pre>
  
  <p>Any thoughts or suggestions on how I can get the foreach loop to go to the next item in the selected listbox?</p>
  
  <p>Also, this is just a snippet as I have about 11 case items to loop through.</p>