Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Tag Property - What does it do and how does it work?

elway23elway23 Member Posts: 57
In my blackjack game, our teacher suggested to use the Tag property to keep track of things. I'm guessing he meant values of the cards. I have 2 books on C# and neither one of them talks about the Tag property. I also haven't found much online that helps me figure out how to use it?

How does one go about using the Tag property with an image list of 52 different cards?

Also, can anyone point me to a decent website that may help explain the Tag property's use?

Thanks!

Comments

  • GenjuroGenjuro Member Posts: 913
    : In my blackjack game, our teacher suggested to use the Tag property to keep track of things. I'm guessing he meant values of the cards. I have 2 books on C# and neither one of them talks about the Tag property. I also haven't found much online that helps me figure out how to use it?
    :
    : How does one go about using the Tag property with an image list of 52 different cards?
    :
    : Also, can anyone point me to a decent website that may help explain the Tag property's use?
    :
    : Thanks!
    :

    Well, the "Tag" property data type is "Object". So, you can throw in whatever (class) you want.
    It's its function: to keep your data (that's why it's an "Object" data type) inside the user interface. Not much to explain.

    For instance, in a Tree control (TreeView? Can't remember its name), every node has its own Tag. So you could easily create a tree, and if you put the object a given node represents into a Tag, you'll always have Tree Nodes and your object in a synchronized data structure (ie-organized as a tree).
  • Chris BrownChris Brown USAMember Posts: 4,496 ✭✭

    _____ [ http://forcoder.org ] free ebooks and video tutorials about [ R PL/SQL Objective-C Ruby Assembly C++ Java Scratch MATLAB C PHP Visual Basic .NET Python Visual Basic Swift Go JavaScript Delphi C# Perl Lisp SAS Scala Alice VBScript ABAP Hack ML D Kotlin Lua Ada Rust Scheme LabVIEW Logo Crystal Fortran F# COBOL FoxPro Transact-SQL Apex Awk Bash Julia Dart Erlang Prolog Clojure ] _____________

Sign In or Register to comment.