0
Private Sub combobox1_TextChanged(sender As Object, e As EventArgs) Handles ComboBox1.TextChanged
    ComboBox1.Items.Clear()
    For Each s As String In listOfString
        If s.Contains(ComboBox1.Text) Then
            ComboBox1.Items.Add(s)
        End If
    Next
    'ComboBox1.DroppedDown = True
End Sub

When I use my following sub, my text caret keeps returning to the front of the combobox every time I enter a new character. I want it to stay in position and not move to the front. How do I do this?

Mathieu Guindon
  • 69,817
  • 8
  • 107
  • 235
sebslaman
  • 3
  • 3
  • do you have to set it to always `.Select` to the end of the combobox's text? https://learn.microsoft.com/en-us/dotnet/api/system.windows.forms.combobox.select?redirectedfrom=MSDN&view=netframework-4.7.2#System_Windows_Forms_ComboBox_Select_System_Int32_System_Int32_ while it might work it feels pretty hack-y – Marcucciboy2 Sep 06 '18 at 17:46
  • I used {Dim loc As Integer = ComboBox1.SelectionStart} at the beginning of sub. Then used {ComboBox1.SelectionStart = loc} at end of sub to save and load position. – sebslaman Sep 06 '18 at 17:48
  • 2
    [This](https://stackoverflow.com/a/35018778/1188513) seems to be doing what you're trying to achieve. – Mathieu Guindon Sep 06 '18 at 18:03

0 Answers0