PureSc0pe Posted March 24, 2004 Posted March 24, 2004 I am trying to make the results of what I Browse to show up in a TextBox. I don't want to actually open anything, just have the location of the selected file displayed in a TextBox. VB Code: Dim ofDialog As New OpenFileDialog With ofDialog .InitialDirectory = "C:\list.txt" .Filter = "textfiles|*.txt" If .ShowDialog = DialogResult.OK Then End If End With ShowDialog.TextBox2. '(<--- Need this part) Quote It's not impossible, it's Inevitable.
*Experts* mutant Posted March 24, 2004 *Experts* Posted March 24, 2004 Use the FileName property of the dialog. TextBoxName.Text = ofDialog.FileName Quote
be58d2003 Posted March 24, 2004 Posted March 24, 2004 Now that the subject is started, I want to basically do the same as PureSc0pe... But, I want to be able for the end-user to be able to select a directory/folder in which he or she reads/writes files from. How can I accomplish this... e.g. "C:\Program Files\MyData\" I want the preferences form to show the current/selected directory in which the files are writtento/read from that particular directory. Quote Firefighters do it with a big hose...
PureSc0pe Posted March 24, 2004 Author Posted March 24, 2004 Use the FileName property of the dialog. TextBoxName.Text = ofDialog.FileName Works...Thanks again. Quote It's not impossible, it's Inevitable.
*Experts* mutant Posted March 24, 2004 *Experts* Posted March 24, 2004 You can use FolderBrowserDialog class from the Windows.Forms namespace. That dialog lets you select directories. Now that the subject is started, I want to basically do the same as PureSc0pe... But, I want to be able for the end-user to be able to select a directory/folder in which he or she reads/writes files from. How can I accomplish this... e.g. "C:\Program Files\MyData\" I want the preferences form to show the current/selected directory in which the files are writtento/read from that particular directory. Quote
be58d2003 Posted March 24, 2004 Posted March 24, 2004 You can use FolderBrowserDialog class from the Windows.Forms namespace. That dialog lets you select directories. Thanks Mutant. :) Quote Firefighters do it with a big hose...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.