Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hey guys,

 

I'm a bit of a newb with Visual Basic. Anyway, I'm currently playing around with deleting and modifying controls. I've created a program where you have to enter a path location for a file you would like to delete and then press a botton to delete it using the "KILL" command.

 

I wanted to expand this program, so I'm trying to add a "BROWSE" function instead of having to type the entire file location yourself manually into the text box.

 

It would make it alot easier and practical (even though I know you could just select the file in windows and hit the delete key).

 

I'm trying to use an "OpenFileDialog" I dunno if thats the write thing to do. My father whos a programmer suggest I use an API Call to do it. But i'm fooling around and I discovered OpenFileDialog.

 

I dunno how do run it though. I can't figure out how to run the diolog and then, when the user chooses a file, how to put the path of that file in Textbox1.text.

 

ANY HELP WOULD HELP!!!

X-Corp

Take a hit

  • *Experts*
Posted

-EDIT-

Derek, your EliteVB class parsing thing seems to be broken. ASP.NET server error. :-\

-EDIT-

 

Try something like this:

Dim ofd As New OpenFileDialog

ofd.ShowDialog()
If (ofd.FileName.Length > 0) Then
 TextBox1.Text = ofd.FileName
End If

Remember, you can always look in your MSDN help file for information about all the .NET controls.

  • *Gurus*
Posted (edited)

Yeah, the nimrods that call themselves Web hosts seem to have misplaced any sign of intelligence. I'm working on getting it up again. I've replaced it with a link straight to the MSDN class library reference.

[edit]MSDN7ITR is working again. Link reverted.[/edit]

Edited by Derek Stone
Posted

Thanks for all your help guys!!

 

And umm. Volteface - I tried out your code. And when I click the button, still.. nothing happens. The dialog doesn't come up or anything.. :(

 

 

Dunno what I should do, so I'm gonna try using the system.windows.form open dialog thing.

X-Corp

Take a hit

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...