我想在按钮单击时浏览文件\项目并在文本框中获取文件路径。
我试过了:
Dim path As String
path=dialog.setpath
textbox1.text=path
这不行,请帮我做这个
答案 0 :(得分:2)
你可以试试这个:
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
Dim oFileDlg As New OpenFileDialog
oFileDlg.ShowDialog()
textbox1.text = oFileDlg.FileName
End Sub