title: VB-Launch file from an auto complete Combo Box
body: <p>I'm having problem with my program. I cannot execute files from a specific directory when I use AutoCompleteCustomSource. Can someone please take a look at my codes and tell me what's wrong</p>
  
  <p>Thank you in advance </p>
  
  <pre><code>Public Class Form1
  Private Execute As New List(Of String)
  
  Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
      ComboBox1.AutoCompleteMode = AutoCompleteMode.SuggestAppend
      ComboBox1.AutoCompleteSource = AutoCompleteSource.CustomSource
      Dim files() As String
      files = System.IO.Directory.GetFiles("D:\Documents")
      For Each f As String In files
          Execute.Add(f)
          ComboBox1.AutoCompleteCustomSource.Add(System.IO.Path.GetFileNameWithoutExtension(f))
  
      Next
      If ComboBox1.Items.Count &gt; 0 Then ComboBox1.SelectedIndex = 0
  End Sub
  
  Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
      If ComboBox1.SelectedIndex &gt; -1 Then
          Process.Start(Execute(ComboBox1.SelectedIndex))
      End If
  End Sub
  </code></pre>