Results 1 to 5 of 5

Thread: forms .tag property usage?

  1. #1

    Thread Starter
    Member
    Join Date
    Mar 2006
    Posts
    52

    forms .tag property usage?

    Hello, I'm trying to make an AIM client and I don't know exactly how to handle multiple forms. I know that I have to give each form a tag but then how would I, when an IM comes in, check to see if it's tag is equal to that tag and then send it to that specific form?
    Thanks

  2. #2
    PoorPoster iPrank's Avatar
    Join Date
    Oct 2005
    Location
    In a black hole
    Posts
    2,728

    Re: forms .tag property usage?

    I don't like the tag property.
    Add a custom property in your form and use it instead. That way, you can store any data type you like.
    like,
    VB Code:
    1. Option Explicit
    2. ' Inside your form
    3. Private m_MyProperty As String
    4.  
    5. Property Get MyProperty() As String
    6.     MyProperty = m_MyProperty
    7. End Property
    8.  
    9. Property Let MyProperty(ByVal Value As String)
    10.     m_MyProperty = Value
    11. End Property
    12.  
    13. Private Sub Form_Load()
    14.     m_MyProperty = "DefaultData"
    15. End Sub
    You can call it from anywhere in your project like any other default property.

    Form1.MyProperty = "YourName"
    MsgBox Form1.MyProperty
    Last edited by iPrank; May 18th, 2006 at 08:03 PM. Reason: Example modified to work on strings.
    Usefull VBF Threads/Posts I Found . My flickr page .
    "I love being married. It's so great to find that one special person you want to annoy for the rest of your life." - Rita Rudner


  3. #3

    Thread Starter
    Member
    Join Date
    Mar 2006
    Posts
    52

    Re: forms .tag property usage?

    I don't need any data type. all I need is a string. how would I do what I asked above?

  4. #4
    Frenzied Member cssriraman's Avatar
    Join Date
    Jun 2005
    Posts
    1,465

    Re: forms .tag property usage?

    The Tag property is simply a container for any data related to the control that you want to store. For example, you might use it to store the initial value displayed in a control so that you can easily restore it if the user wants to undo his or her changes.
    CS

  5. #5
    PoorPoster iPrank's Avatar
    Join Date
    Oct 2005
    Location
    In a black hole
    Posts
    2,728

    Re: forms .tag property usage?

    If I remember correctly, the Tag property hasn't upgraded to .NET. So, migration may cause some problem.

    Edit:
    For restoring original values, you can simply store them as constants inside your form.
    Last edited by iPrank; May 18th, 2006 at 08:02 PM.
    Usefull VBF Threads/Posts I Found . My flickr page .
    "I love being married. It's so great to find that one special person you want to annoy for the rest of your life." - Rita Rudner


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width