Results 1 to 3 of 3

Thread: [RESOLVED] How to handle treeview path to pull from xml

  1. #1
    New Member
    Join Date
    Sep 12
    Posts
    7

    Resolved [RESOLVED] How to handle treeview path to pull from xml

    Hello everybody, I will be on here asking questions all the time so sorry about that.
    Just a setup, i created this app (using AutoIt) that will let me pick an item in a treeview then map drives based off the path that looks into an xml file.

    So after hearing about it from many people, saying i should use a real language to make this little utility I am trying to learn vb. I setup the tree view and setup a button that will map the drive later. As of now the button just returns a messagebox showing the full path of the item selected.

    What is the best way to go about this from here? Before i took the path something like "folder1\subfolder\anotherfolder" and I would split the string into an array. Then based on each array node i could find the paths from the XML. But im hearing now i should us another method to do this since VB has so many more options. And i cant even split the string into an array... im totally lost.

    Help please! (ive been looking on the help files and stuff but its just so much info i have no idea where to start.)

  2. #2
    New Member
    Join Date
    Sep 12
    Posts
    7

    Re: How to handle treeview path to pull from xml

    At this point i would be good just to know why this isn't working.
    I have a treeview setup named PathT then i have this code thats finding the full path of what I selected in the tree. Then trying to split the string out by \. But in the treeA line its saying there is an issue with my split section, between "Char" and "(" there should be a comma?

    Then later in the messagebox area it says treeA was not declared or something.

    Private Sub mapB_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mapB.Click
    'MessageBox.Show(pathT.SelectedNode.FullPath)
    Dim pathS As String = pathT.SelectedNode.FullPath
    Dim treeA() As String = Split(pathS, Char("/"))
    MessageBox.Show(treeA(1))
    End Sub

  3. #3
    New Member
    Join Date
    Sep 12
    Posts
    7

    Re: How to handle treeview path to pull from xml

    I figured it out finally, i was just using some options wrong.

    Code:
    Dim pathS As String = pathT.SelectedNode.FullPath
    Dim splitP() As String = pathS.Split("\")
    MessageBox.Show(splitP(0) & splitP(1))

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •