加載一個文件,我現在有下面的代碼:如何從組合框
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
Dim dir = "Path\path\path"
For Each file As String In System.IO.Directory.GetFiles(dir)
ComboBox1.Items.Add(System.IO.Path.GetFileNameWithoutExtension(file))
Next
End Sub
這個代碼是找到一個目錄,並填充在該目錄中的所有文件的名稱的組合框。我希望能夠從組合框中選擇文件名並打開文件。
這就像一個魅力!謝謝! – Enigma04