Do control tags get GC'd?

D

deko

If I assign a value to the Tag property of a control (the Tag property of a
Label, for example), will that get GC'd? Or will it stay there, available
until it is reassigned? I tried using a class member variable (m_value) but
that seems to revert to zero as well.

I have a TreeView on a form and assign the value of a node to the Label's
Tag property when that node is selected. There are other controls on the
form so if the user does something with those other controls, the focus is
lost from the previously selected TreeNode. But if another button is
clicked, I need the value that was stored in the Label's tag so other action
can be taken.

Why am I losing the value I assigned to the Tag property of the Label?

Thanks in advance.
 

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

Top