Ariez Posted March 25, 2003 Posted March 25, 2003 Does anyone have a concrete example of the tag use...? i saw it was about linking data...more... Quote Auto-suggestion: "I have a life" Uncontroled thinking: "So what the.."
Moderators Robby Posted March 25, 2003 Moderators Posted March 25, 2003 button1.tag = "Hello" messagebox.show(DirectCast(button1.Tag, String)) Quote Visit...Bassic Software
Ariez Posted March 25, 2003 Author Posted March 25, 2003 Robby, i love Montreal but this was not very useful. (is the Studebaker still alive?) Quote Auto-suggestion: "I have a life" Uncontroled thinking: "So what the.."
Ariez Posted March 26, 2003 Author Posted March 26, 2003 Let me put it this way. what would be a common use of this prop. It has to be more than an extra string holder. and what about data link? Quote Auto-suggestion: "I have a life" Uncontroled thinking: "So what the.."
Moderators Robby Posted March 26, 2003 Moderators Posted March 26, 2003 It has to be more than an extra string holder.... It pretty much is and what about data link ....I don't know. Quote Visit...Bassic Software
Moderators Robby Posted March 26, 2003 Moderators Posted March 26, 2003 btw, Studebaker's closed years ago. Quote Visit...Bassic Software
Heiko Posted March 26, 2003 Posted March 26, 2003 I use the tag property whenever I want to add some extra information to a control but feel to lazy to program an extra new inherited class. E.g. in our application we have control containers that can be prefilled and arranged with special controls at designtime and/or runtime. In order to clean up on a context switch I need to know, which controls where created at runtime, which were created at designtime. I do this by setting the .Tag in the contstructor If not me.DesignTime Then me.Tag = "Created at Runtime" In other cases I have used the tag (on listviewitems) to keep track of the last time that I updated their status (which could result in an icon change). HTH Heiko Quote .nerd
Ariez Posted March 26, 2003 Author Posted March 26, 2003 well, that's interesting... thats right Heiko, since now we can inherit and add any strongly typed property we like to any control, this tag seems a bit obsolete BUT may be a handy "extra string". Never used it myself but I see that I could have... Anyways i saw somewhere the idea of dataset linking with the tag, it aroused my curiosity...if u guys have some insight on this eventually give it a thread... thx for the input... (Crescent and StCatherine...these were my college wonderyears tag!..I miss it.. gotta go back someday...with my wife this time!!!) Quote Auto-suggestion: "I have a life" Uncontroled thinking: "So what the.."
Moderators Robby Posted March 26, 2003 Moderators Posted March 26, 2003 "with my wife this time!!!" Are you sure? :) I just thought of something I used the tag for, it was a set of 12 radio buttons, each tag represented a value. I had one event handler for all the radios. So a single line of code did what may have taken a large Select Case. Quote Visit...Bassic Software
Ariez Posted March 27, 2003 Author Posted March 27, 2003 right, efficient... Quote Auto-suggestion: "I have a life" Uncontroled thinking: "So what the.."
*Experts* Nerseus Posted March 27, 2003 *Experts* Posted March 27, 2003 I think the tag is a holdover from VB6 but it can be used for whatever you find necessary. I've used it to hold objects in some rare circumstances. As Robby pointed out, you can now easily create a new class to add a few custom properties to controls. I've put boolean values in a TabPage.Tag (to determine if it's ever been visited), for example... -nerseus Quote "I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.