How to store a hidden value in a tree node ?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello to one and all,

Is it possible to store a string value in a tree node, but this value
is not for display, it's for a tool tip. If not, what are my options,
to create a shadow tree which is invisible?

tia.
 
Lucio,

Every from control inherited class has a tag property.
Know that it is an object so you have to use "ToString" in it.

I saw that Ken provided you already the sample on our website.
The only thing is than that you have to change
nd.Text to nd.Tag.ToString

(and fill the tags properly of course)

http://msdn.microsoft.com/library/d...rfsystemwindowsformstreenodeclasstagtopic.asp

It is in my opinion excellent for your problem

I hope this helps,

Cor
 
Is it possible to store a string value in a tree node, but this value
is not for display, it's for a tool tip. If not, what are my options,
to create a shadow tree which is invisible?

\\\
Dim tn As TreeNode = ...
tn.Tag = "Bla"
..
..
..
Dim s As String = DirectCast(tn.Tag, String)
///
 
\\\
Dim tn As TreeNode = ...
tn.Tag = "Bla"
.
.
.
Dim s As String = DirectCast(tn.Tag, String)
///

Mon cher MVP's
Finally it is working, one small problem remains, if I leave the mouse over
an item the entire tooltip will redraw every 5 seconds with a visible
flicker
effect, any ideas? Also, I am puzzled by the design time help of the Tag
property, because normally I receive a small popup box with all the possible
methods/properties of an object, but with Tag I only receive GetType. For
example, ToString, which Cor suggested, does not seem to be included
as a possible method, why is that?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top