I want my to create an explorer like application. What control should i use to show the contents of a directory.
I tried listview and listbox. Unfortunately i was unable to add items in a listview using the function getdirectories("D:\")
I managed to do so with listbox control. But how can i distinguish whether the selected entry is a file or a directory. Code snippet is given below :
Private Sub ListBox1_DoubleClick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListBox1.DoubleClick [B]sel = ListBox1.SelectedItem[/B] ListBox1.Items.Clear() ListBox1.Items.AddRange(System.IO.Directory.GetDirectories(sel)) ListBox1.Items.AddRange(System.IO.Directory.GetFiles(sel)) End Sub
I want that if the sel is file, then it'll be open in its default application,i.e. using system.process.start(sel.filetype).
Else if sel is a directory then the directory will open.