Dim targetFolder As IO.DirectoryInfo Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click '検索元フォルダーを取得 targetFolder = New IO.DirectoryInfo("C:\Windows") 'ファイル名をListBoxに表示 For Each file As IO.FileInfo In targetFolder.GetFiles ListBox1.Items.Add(file.Name) Next End Sub Private Sub ListBox1_SelectedIndexChanged(sender As System.Object, e As System.EventArgs) Handles ListBox1.SelectedIndexChanged '検索元フォルダーのパスとListBoxの項目を \ でつなげて表示 MsgBox(targetFolder.FullName & "\" & ListBox1.SelectedItem) End Sub