HelpOpenFileDialog....

Posts 1–2 of 2 · Page 1 of 1
OpenFileDialog....
I have a textbox, and an OpenFileDialog...

Im wondering how to make the textbox display only the file name in the textbox instead of the whole file path...

Any help, code is appreciated,

I've tried many of ways to try this, and many other user's from another website.. but nothing they suggested worked! Even tried codes on MSDN, and still nothing...


thanks in advanced!
Quote Originally Posted by SAMCRO View Post
I have a textbox, and an OpenFileDialog...

Im wondering how to make the textbox display only the file name in the textbox instead of the whole file path...

Any help, code is appreciated,

I've tried many of ways to try this, and many other user's from another website.. but nothing they suggested worked! Even tried codes on MSDN, and still nothing...


thanks in advanced!
Code:
Dim OFD As New OpenFileDialog
If Not OFD.ShowDialog = DialogResult.Cancel Then
TextBox1.Text = System.I O.Path.GetFileName(OFD.FileName)
End If


Remove the space between I and O in third line of code.
Posts 1–2 of 2 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Need help?