How to

iebidan

Well-known member
Joined
Feb 6, 2003
Messages
484
Maybe this has been posted, but I cant find a post to solve the problem... here is my problem

How can I make a Form that gets called from a Module be an MDIChild????, the Me statement seems not to work here :D I just need to pass to the form who is the MDIParent, but cant find the correct way to do it

Regards
 
Youll need a reference to the MDIParent form inside the module. Im not sure of your code, but maybe you could pass the instance of the MDI form to the function in your module?

Once you have it, just set the child forms MdiParent property to the instance of the MDI form.

-Ner
 
The code in the function of the module is pretty simple

[VB]
Module mLoader

Friend Function LoadForm(ByVal _Key as String)
Select Case _Key
Case "CLIENTS"
Dim FormClient as FClients = New FClients()
FormClient.MdiParent = ????????
FormClient.Show()
End Select

End Function

End Module
[/VB]

The problem is how do I pass who is the MDIParent, I thought that declaring an Variable containing the MDIParent solved the problem, but thats not true

Hope you can help me out with this, look pretty simple but cant find the correct way to do it
 
make you function look like this:
Code:
Friend Function LoadForm(ByVal _Key As String, ByVal mdiparentform as yourformclassname)
pass in the instance of your mdi parent
  Select Case _Key
      Case "CLIENTS"
         Dim FormClient As FClients = New FClients()
         FormClient.MdiParent = mdiparentform use the passed instance as the parent
         FormClient.Show()
   End Select

End Function
 
Back
Top