|
-
Oct 30th, 2002, 02:07 PM
#1
Thread Starter
Fanatic Member
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.
-
Oct 30th, 2002, 03:15 PM
#2
Fanatic Member
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:
Sub GetNodeKeySuffix()
Dim strKeyNode As String
Dim intKeySep As Integer
Dim strKeySuffix As String
strKeyNode = TreeView1.SelectedItem.Key
intKeySep = InStr(1, strKeyNode, "_", vbTextCompare)
strKeySuffix = Right$(strKeyNode, (Len(strKeyNode) - intKeySep))
If strKeySuffix = "Your compare text here" Then
'Don't create node
End If
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!
-
Oct 30th, 2002, 03:38 PM
#3
Thread Starter
Fanatic Member
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.
-
Oct 30th, 2002, 06:51 PM
#4
Fanatic Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|