xcorp Posted July 23, 2003 Posted July 23, 2003 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!!! Quote X-Corp Take a hit
*Gurus* Derek Stone Posted July 23, 2003 *Gurus* Posted July 23, 2003 (edited) [msdn]System.Windows.Forms.OpenFileDialog[/msdn] Edited July 23, 2003 by Derek Stone Quote Posting Guidelines
*Experts* Volte Posted July 23, 2003 *Experts* Posted July 23, 2003 -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 IfRemember, you can always look in your MSDN help file for information about all the .NET controls. Quote
*Gurus* Derek Stone Posted July 23, 2003 *Gurus* Posted July 23, 2003 (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 July 23, 2003 by Derek Stone Quote Posting Guidelines
*Experts* mutant Posted July 23, 2003 *Experts* Posted July 23, 2003 Use IO.File.Delete instead of Kill. :D Quote
xcorp Posted July 24, 2003 Author Posted July 24, 2003 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. Quote X-Corp Take a hit
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.