Click here to Skip to main content
15,903,362 members
Home / Discussions / Visual Basic
   

Visual Basic

 
Questionuser defined type Pin
Marc Soleda25-Jan-06 4:13
Marc Soleda25-Jan-06 4:13 
AnswerRe: user defined type Pin
Joshua Quick25-Jan-06 7:57
Joshua Quick25-Jan-06 7:57 
GeneralRe: user defined type Pin
Marc Soleda25-Jan-06 20:37
Marc Soleda25-Jan-06 20:37 
QuestionTreeView with selective directoriy pathes Pin
cosma21725-Jan-06 4:03
cosma21725-Jan-06 4:03 
AnswerRe: TreeView with selective directoriy pathes Pin
Joshua Quick25-Jan-06 20:00
Joshua Quick25-Jan-06 20:00 
GeneralRe: TreeView with selective directoriy pathes Pin
cosma21726-Jan-06 3:11
cosma21726-Jan-06 3:11 
GeneralRe: TreeView with selective directoriy pathes Pin
Joshua Quick26-Jan-06 7:37
Joshua Quick26-Jan-06 7:37 
AnswerRe: Solution found ==> TreeView with selective directoriy pathes Pin
cosma2178-Feb-06 12:14
cosma2178-Feb-06 12:14 
I found the solution. This code suppose to work
VB.NET / Framework 2.0

This code is not my mental extract but it works. Only same little modifications I made
If the code doesn't work please let me know.

Public Class FillTreeView
Public Sub initilizeFillTreeView()

Dim i As Integer
Dim arrNames(8) As String
Dim node As TreeNode

arrNames(0) = "C:\Musik\Phil Collins\Live"
arrNames(1) = "C:\Musik\Phil Collins\Live\Lamp Lies down"
arrNames(2) = "C:\Dokumentation\Musik\Phil Collins"
arrNames(3) = "C:\Phil Collins\Dokumentation\Musik"

node = Form1.TreeView1.Nodes.Add(0, "Root")

For i = 0 To 3
addNode(node, arrNames(i))

Next

End Sub

Public Sub addNode(ByVal node As TreeNode, ByVal name As String)

Dim curNode As TreeNode
Dim subString() As String = name.Split("\")
Dim curName As String = subString(0)
Dim nextName As String = ""
Dim i As Integer

subString.Length > 1 Then
For i = 1 To subString.Length - 1
nextName &= subString(i) & "\"
Next
nextName = nextName.TrimEnd("\")
End If

Dim exsist As TreeNode = New TreeNode("")

For Each curNode In node.Nodes
If curNode.Text = curName Then
exsist = curNode
End If
Next

If exsist.Text <> "" Then
addNode(exsist, nextName)
Else
Dim newNode As TreeNode = New TreeNode(curName)
node.Nodes.Add(newNode)

If nextName <> Nothing Then
addNode(newNode, nextName)
End If

End If
End Sub

End Class
Questionadding multiple computers in Active Directory Pin
shanemarkley25-Jan-06 3:47
shanemarkley25-Jan-06 3:47 
Questionscripting printing options Pin
shanemarkley25-Jan-06 3:37
shanemarkley25-Jan-06 3:37 
Questionplease help Pin
anewvbguy25-Jan-06 0:32
anewvbguy25-Jan-06 0:32 
QuestionDelete a selected range of pages from a word document Pin
Regardt25-Jan-06 0:25
Regardt25-Jan-06 0:25 
AnswerRe: Delete a selected range of pages from a word document Pin
Joshua Quick25-Jan-06 19:33
Joshua Quick25-Jan-06 19:33 
QuestionPrintPreviewControl: mouxe x,y to actual document x,y? Pin
Duncan Edwards Jones24-Jan-06 23:20
professionalDuncan Edwards Jones24-Jan-06 23:20 
QuestionUpdate database using dataset Pin
mayhem_rules24-Jan-06 21:44
mayhem_rules24-Jan-06 21:44 
AnswerRe: Update database using dataset Pin
Gokulan Venattil24-Jan-06 23:07
Gokulan Venattil24-Jan-06 23:07 
Questionsql inquiry Pin
maytel24-Jan-06 19:32
maytel24-Jan-06 19:32 
AnswerRe: sql inquiry Pin
Mahbub895724-Jan-06 20:25
Mahbub895724-Jan-06 20:25 
AnswerRe: sql inquiry Pin
ver08287424-Jan-06 20:54
ver08287424-Jan-06 20:54 
GeneralRe: sql inquiry Pin
Matthew Hazlett24-Jan-06 21:16
Matthew Hazlett24-Jan-06 21:16 
AnswerRe: sql inquiry Pin
Guffa24-Jan-06 22:15
Guffa24-Jan-06 22:15 
QuestionSmart tags in Office Research Service Pin
Gokulan Venattil24-Jan-06 18:13
Gokulan Venattil24-Jan-06 18:13 
QuestionDatagrid Pin
welbert24-Jan-06 16:54
welbert24-Jan-06 16:54 
AnswerRe: Datagrid Pin
Dave Kreskowiak24-Jan-06 17:25
mveDave Kreskowiak24-Jan-06 17:25 
QuestionPass parameters and execute a console Application from VB.NET? Pin
Freddie Code24-Jan-06 14:42
Freddie Code24-Jan-06 14:42 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.