Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Invalid Key inserting nodes into treeview

115 views
Skip to first unread message

carlos marquez

unread,
Feb 28, 2003, 8:48:48 AM2/28/03
to
I have a problem whereby what ever key I try to use to
insert a node into a treeview control results in error
message "Invalid Key" no 35603. I have Visual Studio 6
with Service Pack 4

Any ideas??
Carlos

Slavic Kozyuk

unread,
Feb 28, 2003, 9:07:06 AM2/28/03
to
Make sure that the first character of your key is not a numeric value.


For example if your key is "5", CStr(5), "5_Dogs", treeview will give you an
error.

To overcome this just add prefix to your real key "K5", "K5_Dogs", etc...


Hope this helps...

"carlos marquez" <carlos....@za.pwcglobal.com> wrote in message
news:05b201c2df30$1ec311c0$a501...@phx.gbl...

Jan Hyde

unread,
Feb 28, 2003, 10:51:20 AM2/28/03
to
"Slavic Kozyuk" <skozyuk[NO@SPAM]mazzellalifting.com>'s wild
thoughts were released on Fri, 28 Feb 2003 09:07:06 -0500
bearing the following fruit:

>Make sure that the first character of your key is not a numeric value.
>
>
>For example if your key is "5", CStr(5), "5_Dogs", treeview will give you an
>error.
>
>To overcome this just add prefix to your real key "K5", "K5_Dogs", etc...
>
>

What you have said is incorrect.

As long as the key is not numeric it is allowed

It is preferable to have the number first, suffixed with a
character. That way you simply use the VAL() function to
return the number from the key.

J

>
>
>
>"carlos marquez" <carlos....@za.pwcglobal.com> wrote in message
>news:05b201c2df30$1ec311c0$a501...@phx.gbl...
>> I have a problem whereby what ever key I try to use to
>> insert a node into a treeview control results in error
>> message "Invalid Key" no 35603. I have Visual Studio 6
>> with Service Pack 4
>>
>> Any ideas??
>> Carlos
>>
>


--

Hijack: A tool for changing airline tires. (Leopold Fechtner)

def...@junk.com

unread,
Mar 3, 2003, 2:46:05 AM3/3/03
to
Thanks for your advice guys, but it doesn't work
regardless of the letter or number being first.

Carlos

>.
>

bob

unread,
Mar 5, 2003, 3:35:52 AM3/5/03
to
The following code shoul get u a clear understanding.

For intI = 1 To 5

Set FirstNode = TreeView1.Nodes.Add(,tvwFirst, , "Node: "
& intI)
TreeView1.Nodes.Add FirstNode, tvwChild, "C" &
intI, "Child Node of Parent " & intI

Next

-Bob.

>.
>

Jan Hyde

unread,
Mar 6, 2003, 3:40:14 AM3/6/03
to
"carlos....@za.pwcglobal.com" <def...@junk.com>'s wild
thoughts were released on Sun, 2 Mar 2003 23:46:05 -0800
bearing the following fruit:

>Thanks for your advice guys, but it doesn't work
>regardless of the letter or number being first.


Please post your code.

J


--

My wife went to the corner market.
Bought two corners.

(Henny Youngman)

0 new messages