Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Passing Parameter
Message
 
To
01/05/2001 00:24:53
General information
Forum:
Visual Basic
Category:
Other
Miscellaneous
Thread ID:
00501865
Message ID:
00501899
Views:
15
>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
Previous
Reply
Map
View

Click here to load this message in the networking platform