View Single Post
  #9 (permalink)  
Old September 13th, 2004, 07:16 AM
bmains bmains is offline
Friend of Wrox
Join Date: Jun 2003
Location: Harrisburg, PA, USA.
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts


When you open a form, you typically do:

objForm = New Form1

Now say you want to pass in a reference to the current form (pass in a reference of the currently opened form to Form1, you could do:


That function would be defined as:

Public Sub DoSomethingWithForm(ByRef objForm As Form1)
  'code here
End Sub

Also, I like to set the owner property, which is the reference to the owner form. So what I do is:

objForm = New Form1
objForm.Owner = Me

And in the Form1 code, you reference the owner.

Reply With Quote