So a while ago, I was playing around with C# and designing forms, and I saw they had a really cool variable called "tag" that was in all of their form objects (buttons, text fields, labels, etc.).

So for example, if you had some sort of networking app, wanted to store some per-button data such an IP address, you could go ahead and cram that into the tag field. You could even make entire classes to put into the tag field.

I really liked this pattern, because my tag could travel around with the button, instead of me having to store somewhere a hash table from button-id to my would-be-tag class.

I've looked around, and I've seen no mention of this being a pattern, or anyone talking about this variable. What do you guys think of it? Is it a pattern worth knowing and using?