Aspx Listbox rows match count issue
<p>I have a strange issue when adding items to a listbox. I want it to adjust it's size to match it's count. When adding 1 all is fine, add the second and the rows go to 4 then after we have more than 4 all is working fine. The other thing is the location of the top of the listbox also moves up a few pixels - wierd. Is this a bug? This is the button event code for adding them. Updated!</p>

<pre><code>Dim s As String = tbTest.Text
If Not s = "" Then
  Dim li As New ListItem(s)
  If Not lsbTest.Items.Contains(li) Then
    lsbTest.Items.Add(li)
    Dim i As Integer = lsbTest.Items.Count
    lsbTest.Rows = i
    lsbTest.Height = i * 22
  End If
End If
</code></pre>
