Click to See Complete Forum and Search --> : Outline Control


Limor Janah
August 9th, 2001, 12:17 AM
Hi

I am trying to use the outline control
and i dont understand it.
can someone please tell me how to add
a subitems to an item (the help file doesnt help)


thanks
limor

John G Duffy
August 9th, 2001, 12:56 PM
Here is an example I found On Microsoft Development network for the Outline control. I should note that the Outline control is old stuff and has been replaced by the Treeview control. It is only a matter of time before Outline control support will be dropped.

option Explicit
Dim FIndent as Integer
Dim FIndex as Integer
Dim StrtPath as string

private Sub Drive1_Change()
Outline1.Clear
Outline1.AddItem Drive1.Drive & "\"
FIndent = 1
FIndex = 0
StrtPath = Drive1.Drive
Get_Files StrtPath
MsgBox "OK"
End Sub

private Sub Get_Files(FPath as string)
Dim File_Name as string
Dim File_Path as string
Dim File_Read as Integer
Dim X as Boolean
Dim I as Integer

FIndent = FIndent + 1
File_Path = FPath & "\"
File_Name = Dir$(File_Path, vbDirectory)
File_Read = 1
X = false

Do While File_Name <> ""
If File_Name <> "." And File_Name <> ".." then
If GetAttr(File_Path & File_Name) <> vbDirectory then
Outline1.AddItem File_Name
FIndex = FIndex + 1
Outline1.Indent(FIndex) = FIndent
else
StrtPath = File_Path & File_Name
Outline1.AddItem File_Name
FIndex = FIndex + 1
Outline1.Indent(FIndex) = FIndent
X = true
Get_Files StrtPath
End If
End If
If X = true then
File_Name = Dir$(File_Path, vbDirectory)
for I = 2 to File_Read
File_Name = Dir$
next
X = false
End If
File_Name = Dir$
File_Read = File_Read + 1
Loop
FIndent = FIndent - 1
End Sub






John G

Limor Janah
August 12th, 2001, 06:10 AM
thank you

limor