# Auto Completing a combo box

**URL:** <https://forums.thehomestack.io/t/auto-completing-a-combo-box/368>\
**Category:** vb.Net\
**Created:** [March 27, 2010, 4:08pm UTC](https://forums.thehomestack.io/t/auto-completing-a-combo-box/368 "2010-03-27T16:08:01Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://forums.thehomestack.io/uploads/default/original/1X/161426793bc0d8bdf0d1a6692b3e44446861cc72.jpeg) [@system](https://forums.thehomestack.io/u/system)\
**Post date:** [March 27, 2010, 4:08pm UTC](https://forums.thehomestack.io/t/auto-completing-a-combo-box/368/1 "2010-03-27T16:08:01Z")

</div>

ComboBox1.AutoCompleteSource = AutoCompleteSource.ListItems

You can do this through the Properties window for the Combobox too. I used code to make the point more clear. Here’s the complete source code that you could plug into the Load event subroutine for a Form.

```auto
   Dim Mary As New List(Of String)
   Dim Words() As String = New String() _
       {"Mary", "Had", "A", "Little", _
       "Lamb.", "It's", "Fleece", _
       "Was", "White", "As", "Snow."}
   Mary.AddRange(Words)
   Mary.Sort()
   ComboBox1.Items.AddRange(Mary.ToArray)
   ComboBox1.DropDownStyle = ComboBoxStyle.DropDownList
   ComboBox1.AutoCompleteSource = AutoCompleteSource.ListItems
   ComboBox1.SelectedIndex = 0

```
