vb.net 的openfiledialog问题
怎么把openfiledialog选中的多个文件的文件名导入到列表listbox中呀PrivateSubButton1_Click(ByValsenderAsSystem...
怎么把openfiledialog选中的多个文件的文件名导入到列表listbox中呀
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
OpenFileDialog1.Multiselect = True
If OpenFileDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then
If Not (OpenFileDialog1.FileName Is Nothing) Then
add(OpenFileDialog1.FileName)
End If
End If
End Sub
Private Sub add(ByVal pp As String)
MessageBox.Show(pp, "adsd")
If pp <> "" Then
ListBox1.BeginUpdate()
ListBox1.Items.Add(pp)
ListBox1.EndUpdate()
End If
End Sub
就是搞不出,只有一个导入了进去 展开
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
OpenFileDialog1.Multiselect = True
If OpenFileDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then
If Not (OpenFileDialog1.FileName Is Nothing) Then
add(OpenFileDialog1.FileName)
End If
End If
End Sub
Private Sub add(ByVal pp As String)
MessageBox.Show(pp, "adsd")
If pp <> "" Then
ListBox1.BeginUpdate()
ListBox1.Items.Add(pp)
ListBox1.EndUpdate()
End If
End Sub
就是搞不出,只有一个导入了进去 展开
展开全部
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
OpenFileDialog1.Multiselect = True
If OpenFileDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then
ListBox1.Items.Clear()
ListBox1.Items.AddRange(OpenFileDialog1.FileNames)
End If
End Sub
OpenFileDialog1.Multiselect = True
If OpenFileDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then
ListBox1.Items.Clear()
ListBox1.Items.AddRange(OpenFileDialog1.FileNames)
End If
End Sub
启帆信息
2024-11-19 广告
2024-11-19 广告
启帆信息是英伟达中国区代理商,原厂授权代理,提供全面的软件技术解决方案以及NVIDIA以太网产品、交换机等产品,欢迎前来咨询!...
点击进入详情页
本回答由启帆信息提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询