title: how do i return arraylist from a function?
body: <p>I learnt example from msdn to populate a listbox control with arraylist. 
  <a href="http://msdn.microsoft.com/en-us/library/1818w7we(v=VS.100).aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/1818w7we(v=VS.100).aspx</a></p>
  
  <p>I want to create a function which will give return the USStates arraylist and use the returned value as datasource for listbox1</p>
  
  <pre><code>    Dim USStates As New ArrayList()
      USStates.Add(New USState("Alabama", "AL"))
      USStates.Add(New USState("Washington", "WA"))
      USStates.Add(New USState("West Virginia", "WV"))
      USStates.Add(New USState("Wisconsin", "WI"))
      USStates.Add(New USState("Wyoming", "WY"))
      ListBox1.DataSource = USStates
  
      ListBox1.DisplayMember = "LongName"
      ListBox1.ValueMember = "ShortName
  </code></pre>
  
  <p>I tried creating a function like:</p>
  
  <pre><code>Public Shared Function FillList() As ArrayList()
      Dim USStates As New ArrayList()
      USStates.Add(New USState("Alabama", "AL"))
      USStates.Add(New USState("Washington", "WA"))
      USStates.Add(New USState("West Virginia", "WV"))
      USStates.Add(New USState("Wisconsin", "WI"))
      USStates.Add(New USState("Wyoming", "WY"))
      return usstates
  end function
  </code></pre>
  
  <p>but it says error:
  Value of type 'System.Collections.ArrayList' cannot be converted to '1-dimensional array of System.Collections.ArrayList'.  </p>