Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Passing Parameter
Message
 
À
01/05/2001 00:24:53
Information générale
Forum:
Visual Basic
Catégorie:
Autre
Divers
Thread ID:
00501865
Message ID:
00501899
Vues:
16
>In VFP I was able to call a child form and pass to it a parameter the parent form as an object, so all properties, methods and events are available to the child form (ex. DO FORM MYCHILDFORM WITH THISFORM)
>
>Is it possible to do the same in VB? If yes, How?

If you want to access properties and methods of a form from another one, these must be public.

If you want to give a reference of a form to another form, you need to add a public method to the child that accept a form as parameters.
Private mParent as Form

Public Sub GiveMePointer(pParent as Form)
Set pParent = mParent
Me.show
End Sub

To display this form, you can use this:
frmChild.GiveMePointer Me
Éric Moreau, MCPD, Visual Developer - Visual Basic MVP
Conseiller Principal / Senior Consultant
Moer inc.
http://www.emoreau.com
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform