Results 1 to 6 of 6

Thread: How can you load multiple instances of a form, and interact with each seperately?

Threaded View

  1. #5
    PowerPoster jcis's Avatar
    Join Date
    Jan 2003
    Location
    Argentina
    Posts
    4,430

    Re: How can you load multiple instances of a form, and interact with each seperately?

    Property Let: Assign to variable
    Property Get: Get variable/Object
    Property Set: Assign to object

    Wih them you pass or get data to/from Forms, it's better than just using Public variables/Objects inside them. So inside each Chat Form you can have:
    VB Code:
    1. Private FrmParent As Form
    2.  
    3. Public Property Set ParentForm(pForm As Form)
    4.     Set FrmParent = pForm
    5. End Property
    And show each Form with:
    VB Code:
    1. Dim Frm as Form1  
    2.     Set Frm = New Form1
    3.     Load Frm
    4.     'Assing values to Properties or Public variables in Frm before show
    5.     'you can send this Form (Parent) as a Property Set
    6.     Set Frm.ParentForm = Me 'Now Frm knows who is its Parent
    7.     Frm.Show
    Now Frm can use its Parent to Get or Send info
    VB Code:
    1. Me.BackColor = FormParent.BackColor 'Get something
    2. FormParent.Caption = "Hey Im " & Me.Name & " Sending This" 'Send Something
    Last edited by jcis; Jan 29th, 2007 at 07:57 PM.

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