What is The Code for A Open File Dialog... Like A Open Button You Click it then you Select The File You Want!:) :)
Printable View
What is The Code for A Open File Dialog... Like A Open Button You Click it then you Select The File You Want!:) :)
you've asked this question before and got the correct answer too.
For Folder:
vb Code:
If Browsedialog.ShowDialog(Me) <> DialogResult.Cancel Then TextBox2.Text = Browsedialog.SelectedPath End If
For file:
vb Code:
Private Function GetFile() As String Dim f As New OpenFileDialog f.Title = "Choose file" f.CheckFileExists = True f.DefaultExt = "PSD" f.Filter = "PSD files (*.psd)|*.psd|All files (*.*)|*.*" f.RestoreDirectory = True If f.ShowDialog() = DialogResult.OK Then Return f.FileName End If Return "" End Function
You Are Correct but For Some reason when i try to load the file it won't load it all as if i open it up in Notepad so I am seeing if it was the way the Open File Dialog was created!:) :D :)Quote:
Originally Posted by .paul.
may i know how can i display the full path of the file i chose from the open file dialog into a textbox or label?
vb Code:
textbox1.text = openfiledialog1.filename