SkiesOfBordom

hi,

is there a control that will allow me to display contents of a local directory as a list without the file extensions

I have tried the webbrowser control, but it gives me this error with the following code:
cannot convert type 'string' to type "system.uri"

Private Sub map_ex_reg_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles map_ex_reg.CheckedChanged
If map_ex_reg.Checked = True Then
WebBrowser1.Url = My.Forms.tool.q2_dir.Text + "/baseq2/maps"
End If
End Sub

any help would be appreciated.



Re: Visual Basic General control to display contents of directory??

Aw Ali

I am afraid I did not understand your question throughly, but you can view the files in a directory using the OpenFileDialog. To view the subforlders, you can use FolderBrowserDialog.

Please clarify your question if that is not what you want.






Re: Visual Basic General control to display contents of directory??

SkiesOfBordom

oh whoops, sorry. I don't want it as a dialog box. i need it as a control that you can drop in a form. something like the web browser one, but one that accepts variables as the path.

I need to use this exact code as the path:

path = My.Forms.tool.q2_dir.Text + "/baseq2/maps"

this code takes the current text out of the text box in a different form, adds custom text and assigns it to the string variable "path"

but i need a control that would take that path and load it as a list into my app with the file ext's

is there any control that will do this that is not a dialog box





Re: Visual Basic General control to display contents of directory??

Aw Ali

Now I am on the road...

You are looking for something like VB6's FileListBox. Right Click on tools, the Choose Item and from the list, locate and add "FileListBox". To Set the path, FileListBox1.path="C:\..."

Hope that is what you are looking for.






Re: Visual Basic General control to display contents of directory??

cybertaz69

Load into A listbox or a combobox or any other control......

Need to wrap the code into some error handleing.......

Code Snippet

For Each file As String In My.Computer.FileSystem.GetFiles("c:\temp\")

Me.ListBox1.Items.Add(IO.Path.GetFileName(file))

Next

Replace "C:\temp\" with me.textbox1.text






Re: Visual Basic General control to display contents of directory??

SkiesOfBordom

Aw Ali, thanks. that did it Big Smile