VS2010里的VB问题:如何用 OpenFileDialog 组件打开多个文件到listbox里
2个回答
展开全部
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
OpenFileDialog1.Filter = "All files(*.*)|*.*"
OpenFileDialog1.FileName = ""
OpenFileDialog1.Multiselect = True
OpenFileDialog1.ShowDialog()
If OpenFileDialog1.FileNames.Length > 0 Then
ListBox1.Items.Clear()
For Each fn As String In OpenFileDialog1.FileNames
ListBox1.Items.Add(fn)
Next
End If
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询