|
-
Sep 2nd, 2002, 11:24 PM
#1
Thread Starter
New Member
How to create a form explorer?
Hello,
I've faced a problem when i try to create a explorer-style interface where the window's left pane contains of a tree view and a display area on the right where the selected form (on left pane)will show on this area. It should be a single document interface where no MDI technic should be applied here. I've tried it many days already..... I really don't know how to solve it.. (
Any body outhere can give me a hand. Your help is indeed appreciated.....
Regards,
Guy99
-
Sep 3rd, 2002, 12:57 PM
#2
PowerPoster
hi
Heres the code, I did it a few days back.
I have used images using a imagelist, you shd comment out the statements if you do not want them, else it will give u an error
Code:
Dim objFileSystem As New FileSystemObject()
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
ShowDefaultView()
TreeView1.Nodes(0).Expand()
End Sub
Private Sub ShowDefaultView()
TreeView1.Nodes.Clear()
TreeView1.Nodes.Add("My Computer")
TreeView1.Nodes(0).ImageIndex = 2
TreeView1.Nodes(0).SelectedImageIndex = 2
Dim MDrive As Drive
Dim MFolder As Folder
Dim DriveFolders As Folder
Dim ctr As Integer
Dim n As Integer
ctr = 0
Dim ImageNumber As Integer
For Each MDrive In objFileSystem.Drives
TreeView1.Nodes(0).Nodes.Add(MDrive.Path)
Select Case (MDrive.DriveType)
Case DriveTypeConst.CDRom
ImageNumber = 3
Case DriveTypeConst.Removable
ImageNumber = 4
Case Else
ImageNumber = 5
End Select
TreeView1.Nodes(0).Nodes(ctr).ImageIndex = ImageNumber
TreeView1.Nodes(0).Nodes(ctr).SelectedImageIndex = ImageNumber
If MDrive.IsReady Then
DriveFolders = objFileSystem.GetFolder(MDrive.Path & "\")
For Each MFolder In DriveFolders.SubFolders
TreeView1.Nodes(0).Nodes(ctr).Nodes.Add(MFolder.Name)
Next
End If
ctr += 1
Next
End Sub
Private Sub TreeView1_AfterExpand(ByVal sender As Object, ByVal e As System.Windows.Forms.TreeViewEventArgs) Handles TreeView1.AfterExpand
Dim StartPath As String
Dim f As Folder
Dim subF As Folder
Dim ctr As Integer
StartPath = Mid(e.Node.FullPath(), 13) & "\"
If StartPath = "\" Then
Exit Sub
End If
Try
ctr = 0
For Each f In objFileSystem.GetFolder(StartPath).SubFolders
For Each subF In f.SubFolders
e.Node.Nodes(ctr).Nodes.Add(subF.Name)
Next
ctr += 1
Next
Catch
End Try
End Sub
This is not the complete code...I have deleted some parts which were specific to my app....but shd give you a fair idea.
-
Sep 3rd, 2002, 07:46 PM
#3
Thread Starter
New Member
Hi veryjonny,
Thanx for your replied.....But sorry to say that it's not what i need... I'm not trying to create a window explorer here..
What i want to do is to show a form on the right pane when i click the node on the left pane... And it is not MDI application....The problem here is how can i show the selected form within the main form without using MDI technic.
Again, thanx for your help anyway....
Regards,
Guy99
-
Sep 4th, 2002, 06:17 AM
#4
PowerPoster
hi
Sorry for the misinterpretation of your query...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|