tag property

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • NEHU
    New Member
    • Aug 2007
    • 12

    tag property

    What does tag property for a control specify in VB?
  • QVeen72
    Recognized Expert Top Contributor
    • Oct 2006
    • 1445

    #2
    Hi,

    Every control has a Tag property, you can store any Text Char/Values, and later retrieve it, just like the Text property of TextBox...

    REgards
    Veena

    Comment

    • Killer42
      Recognized Expert Expert
      • Oct 2006
      • 8429

      #3
      Originally posted by NEHU
      What does tag property for a control specify in VB?
      The funny thing is, the Tag property doesn't mean anything to VB. It's just sort of an extra "dummy" property where you can throw any information that you want to store with the control.

      You can use it to represent some sort of "custom property" if you like. For example, I had a program where I wanted to have some things on a form flashing, or blinking (like we used to have on the DOS text screen). I stored a value in the Tag property to identify those controls that I wanted to flash. And set up a timer to check all the controls on the form, and flash the ones which had that value in their Tag.

      Comment

      • SammyB
        Recognized Expert Contributor
        • Mar 2007
        • 807

        #4
        In VB6 and VBA, the Tag property is a string; but in VB.NET, it is an object, so you can easily store lots. For example, when I dynamically add controls to a form at run time, I read a configuration file into a custom info object. Then I use some of that object's properties to initialize the control. And I also put the Info object into the Tag property.

        Comment

        • sgrec7
          New Member
          • Aug 2007
          • 58

          #5
          Originally posted by SammyB
          In VB6 and VBA, the Tag property is a string; but in VB.NET, it is an object, so you can easily store lots. For example, when I dynamically add controls to a form at run time, I read a configuration file into a custom info object. Then I use some of that object's properties to initialize the control. And I also put the Info object into the Tag property.
          what the heck is "VBA" ???? and what does VB 8 (2005) call it's "tag property"

          PS is VB 2005 the same thing as VB.net ???

          Comment

          • Killer42
            Recognized Expert Expert
            • Oct 2006
            • 8429

            #6
            Originally posted by sgrec7
            what the heck is "VBA" ???? and what does VB 8 (2005) call it's "tag property"

            PS is VB 2005 the same thing as VB.net ???
            VBA is Visual Basic for Applications. It's the "scripting" language built into products like Excel, Word and Access. It seems to be pretty much VB without the compiler to create EXEs.

            No idea about what Tag is called in VB 2005.

            As for the versions, see this link - it should answer all questions.

            Comment

            • SammyB
              Recognized Expert Contributor
              • Mar 2007
              • 807

              #7
              Originally posted by sgrec7
              what the heck is "VBA" ???? and what does VB 8 (2005) call it's "tag property"

              PS is VB 2005 the same thing as VB.net ???
              Since there is very little difference between VB 2005 & VB 2003 and they both use the .NET framework, they are refered to as VB.NET. The tag property is called Tag :D and is usually on every control and also sometimes on pieces of a control; for example, the TreeView control has a Tag property for each node, so if you are displaying a drive in a tree view, you can stash the Directory or File object for each node in the Tag property.

              Comment

              • Killer42
                Recognized Expert Expert
                • Oct 2006
                • 8429

                #8
                Originally posted by SammyB
                ... The tag property is called Tag ...
                Damned sneaky, that. :)

                Comment

                Working...