One way is to convert the file name to FileInfo, which contains all kinds of file information, including the path. A dialog box opens and the path to the selected file is displayed.
If OpenFileDialog1.ShowDialog() = System.Windows.Forms.DialogResult.OK Then
Dim fi As New System.IO.FileInfo(OpenFileDialog1.FileName)
TextBox1.Text = fi.DirectoryName
End If