View Single Post
Old 22-04-2007, 03:46 PM   #4
Reup
10 GOSUB Abandonia
20 GOTO 10
 
Reup's Avatar

 
Join Date: Dec 2004
Location: Eindhoven, Netherlands
Posts: 1,508
Default

Use the following code (I'm a C# guy, so I'm not sure if the VB syntax is correct... I more or less HATE VB syntax :P):

Code:
Dim openFileDialog1 as OpenFileDialog
If openFileDialog1.ShowDialog() = System.Windows.Forms.DialogResult.OK Then
******TextBox3.Text = Path.GetFileName( openFileDialog1.FileName )
Whats going on is that you ask the OpenFileDialog to return the complete system path of the selected file and use the static System.IO.Path function parse the FileName for you. Then you set the Text property of the textbox to this.

Your code tried to do quite a lot of other things. By leaving out the .Text, you're trying to set the TextBox object directly instead of its Text property. And, what you think an object of type Type is exactly?
Reup is offline                         Send a private message to Reup
Reply With Quote