iebidan Posted April 29, 2003 Posted April 29, 2003 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 Quote Fat kids are harder to kidnap
*Experts* Nerseus Posted April 29, 2003 *Experts* Posted April 29, 2003 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 Quote "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
iebidan Posted April 29, 2003 Author Posted April 29, 2003 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 Quote Fat kids are harder to kidnap
Guest mutant Posted April 29, 2003 Posted April 29, 2003 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 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.