Results 1 to 4 of 4

Thread: Parsing Text [RESOLVED]

  1. #1

    Thread Starter
    Fanatic Member JCScoobyRS's Avatar
    Join Date
    Oct 2002
    Location
    Some Mountain in Colorado
    Posts
    677

    Parsing Text [RESOLVED]

    I have a TreeView where the node keys are dynamically created. The key is basically the ParentNode.Text_Node.Text so if the structure looked like this:

    Node1
    |_Sub1

    The Key for Sub1 would be "Node1_Sub1". This TreeView also has the ability of having nodes being created on the fly through Drag and Drop. I need to be able to get the key of a highlighted node, which I can already do, parse it to get only the portion after the "_" and then compare it to the text of the node being created if the drop were commensed. Does this make sense? I need to be able to make sure that the node that will be created isn't the same as the node it's being created under. Thanks, Jeremy
    Last edited by JCScoobyRS; Oct 30th, 2002 at 03:38 PM.
    He who listens well, speaks well.

  2. #2
    Fanatic Member Armbruster's Avatar
    Join Date
    Sep 2002
    Location
    Maryland Heights, MO
    Posts
    857
    yeah, i think i understand. I do something a little similar but I don't allow drag and drop. You just need to parse the key name . .

    VB Code:
    1. Sub GetNodeKeySuffix()
    2.     Dim strKeyNode As String
    3.     Dim intKeySep As Integer
    4.     Dim strKeySuffix As String
    5.    
    6.     strKeyNode = TreeView1.SelectedItem.Key
    7.     intKeySep = InStr(1, strKeyNode, "_", vbTextCompare)
    8.     strKeySuffix = Right$(strKeyNode, (Len(strKeyNode) - intKeySep))
    9.  
    10.     If strKeySuffix = "Your compare text here" Then
    11.         'Don't create node
    12.     End If
    13. End Sub
    "Look! Up in the sky! It's a bird! It's a plane! It's Diaper-Head Boy! (there by my name!) Yes, Diaper-Head Boy, who disguised as my son, Seth, fights a never-ending battle for truth, justice and terrorizing my house!

    Resistance is futile, you will be compiled . . . Please!

  3. #3

    Thread Starter
    Fanatic Member JCScoobyRS's Avatar
    Join Date
    Oct 2002
    Location
    Some Mountain in Colorado
    Posts
    677

    Thanks

    Worked like a charm. Thanks, Jeremy

    P.S.- Your kid is cute. He must had gotten his looks from him mom! (Just kidding)
    He who listens well, speaks well.

  4. #4
    Fanatic Member Armbruster's Avatar
    Join Date
    Sep 2002
    Location
    Maryland Heights, MO
    Posts
    857

    Re: Thanks

    Originally posted by JCScoobyRS
    Worked like a charm. Thanks, Jeremy

    P.S.- Your kid is cute. He must had gotten his looks from him mom! (Just kidding)
    ok - watch the funny stuff!

    Glad I could help!!
    "Look! Up in the sky! It's a bird! It's a plane! It's Diaper-Head Boy! (there by my name!) Yes, Diaper-Head Boy, who disguised as my son, Seth, fights a never-ending battle for truth, justice and terrorizing my house!

    Resistance is futile, you will be compiled . . . Please!

Posting Permissions

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



Click Here to Expand Forum to Full Width