title: How to use a listbox.selecteditem to continue work with an array
body: <p>For a small project of mine, I try to build a small Vocabulary trainer. I am using arrays, to store the vocabulary and the translation.
  I have a listbox, where I can choose a specific topic which looks like this:</p>
  
  <pre><code>[void] $ListBox.Items.Add('Weekdays')
  [void] $ListBox.Items.Add('Months')
  [void] $ListBox.Items.Add('Numbers 1-10')
  [void] $ListBox.Items.Add('Numbers 10-20')
  </code></pre>
  
  <p>So as soon as I have my listbox, I can choose from the above 4 topics.
  The issue I am fighting with is, how do I tell the code, that for example
  the before chosen Weekdays, shall go through the array called $weekdays?</p>
  
  <p>I played around with Hashtables to convert weekdays into $weekdays</p>
  
  <pre><code>$Vocabulary = @{Weekdays = $Weekdays; Months = $Months; Numbers = $Numbers}
  </code></pre>
  
  <p>But then I face different problems, not being able to dissolve the code on such way, that I get the first word out of the array as below:</p>
  
  <pre><code>$Weekdays = 'Montag','Dienstag','Mittwoch'
  $weekdays_Answer = 'Monday','Tuesday','Wednesday'
  $Months = 'Januar','Februar','März','April','Mai','Juni'
  $Months_Answer = 'January','February','March','April','May','June'
  </code></pre>
  
  <p>So my question is, what do I have to do, that when I pick 'Weekdays'from the listbox, that with this output, I receive the arrayname '$Weekdays', so I can continue to work from there?</p>
  
  <p>I tried several approaches like:</p>
  
  <pre><code>$Vocabulary[$listbox.SelectedItems]
  
  $test=$listbox.SelectedItems
  
  $Vocabulary['weekdays'][0]
  
  $Vocabularytopic = '$'+$listbox.selecteditem
  
  $($TopicSelection.Values)[$Script:CounterVocabulary]
  </code></pre>
  
  <p>But so far no success, because I am not sure, how to convert the result from the listbox into an array. The closest I got was with:</p>
  
  <pre><code>$Vocabulary['weekdays'][0]
  </code></pre>
  
  <p>but here I failed by exchanging 'weekdays' with $listbox.selecteditems. Maybe you are able to figure this one out?</p>
  
  <p>The reason for having two separate arrays is, that I first question the foreign word and then through a click onto a button, show the answer.</p>
  
  <p>Open for any suggestions and other approaches</p>
  
  <p>Many thanx,</p>
  
  <p>Mike</p>