Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Maybe this has been posted, but I can't 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 can't find the correct way to do it

 

Regards

Fat kids are harder to kidnap
  • *Experts*
Posted

You'll need a reference to the MDIParent form inside the module. I'm 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 form's MdiParent property to the instance of the MDI form.

 

-Ner

"I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut
Posted

The code in the function of the module is pretty simple

 

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

 

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

 

Hope you can help me out with this, look pretty simple but can't find the correct way to do it

Fat kids are harder to kidnap
Guest mutant
Posted

make you function look like this:

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...