File paths

Posts 1–4 of 4 · Page 1 of 1
File paths
When you have used OpenFileDialog and gotten the file path, is there anyway to show only the file but the file path is still there?

Example:

i select hi.txt from my hard drive with the dialog thingy.

it appears like this in a textbox
"C:\hi.txt"


is there anyway to get it to say only
"hi.txt"

but still refer to C:\hi.txt
Quote Originally Posted by MinimalKills View Post
When you have used OpenFileDialog and gotten the file path, is there anyway to show only the file but the file path is still there?

Example:

i select hi.txt from my hard drive with the dialog thingy.

it appears like this in a textbox
"C:\hi.txt"


is there anyway to get it to say only
"hi.txt"

but still refer to C:\hi.txt
PM Xplicit, by going here:
http://www.mpgh.net/forum/private.php?do=newpm&u=188271
He should know this.
Quote Originally Posted by MinimalKills View Post
When you have used OpenFileDialog and gotten the file path, is there anyway to show only the file but the file path is still there?

Example:

i select hi.txt from my hard drive with the dialog thingy.

it appears like this in a textbox
"C:\hi.txt"


is there anyway to get it to say only
"hi.txt"

but still refer to C:\hi.txt
Code:
Textbox1.text = hi.txt
Haha I don´t think that is the right but you should try something like this:
Code:
textbox1.text = C:\ 
textbox2.text = hi.txt

Dim location = Textbox1.text + textbox2.text

Textbox3.text = textbox2.text
Yeah use an openfiledialog

Code:
  Dim browse1 As New OpenFileDialog
        With browse1
            .Filter = "Executables (*.exe)|*.exe"
            .Title = "Please select a file..."
            .CheckFileExists = True
            .CheckPathExists = True
        End With
        If browse1.ShowDialog = Windows.Forms.DialogResult.OK Then
            TextBox1.Text = browse1.SafeFileName ' Makes it so its just the filename not path
        End If
Posts 1–4 of 4 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

Talk with us