Listbox scrolling to the selected item in ASP.net
<p>I wanto to make my ListBox control scroll to the selected item.</p>

<p>Here is my code:</p>

<pre><code>protected void Button2_Click(object sender, EventArgs e)
{
    ListBox1.SelectionMode = ListSelectionMode.Multiple;
    ListBox1.SelectedIndex = -1;
    for (int i = 0; i &lt; ListBox1.Items.Count; i++)
    {
        if (ListBox1.Items[i].Text == TextBox1.Text)
        {
            ListBox1.SelectedIndex = i;

        }
    }
}
</code></pre>

<p>Thank you!</p>
