Aspx Listbox rows match count issue

Broatscat

New Member
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. \[code\]Dim s As String = tbTest.TextIf Not s = "" Then Dim li As New ListItem(s) If Not lsbTest.Items.Contains(li) Then lsbTest.Items.Add(li) End IfEnd IfDim i As Integer = lsbTest.Items.CountIf i <> 0 Then lsbTest.Rows = iEnd If\[/code\]
 
Back
Top