[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 174
  • Last Modified:

Dynamic Objects

I have 2 Forms. One of which contains a control array of frames... I wish to be able to Create new instances of the other form dynamically, selecting one of the panels from the other form, and having that on the new form.
0
sb8gq
Asked:
sb8gq
  • 2
1 Solution
 
bruncheyCommented:
what code are you currently attempting to use to do this?  
how about...


Dim myfrm as new baseform

myfrm.show


0
 
raygibbinsCommented:
Stick this declaration into a module

Declare Function SetParent Lib "user32" (ByVal hWndChild As Long, ByVal hWndNewParent As Long) As Long

I used 2 forms - Form1 and Form2
Form 2 had Frame1 on it

In the form1_load event, the following code
    Dim myForm As Form1
    SetParent Form2.Frame1.hWnd, Form1.hWnd

0
 
raygibbinsCommented:
Re previous answer

The following code is more what you need I think

Private Sub Form_Click()
    Dim myForm As Form1
    Set myForm = New Form1
    myForm.Show
    SetParent Form2.Frame1.hWnd, myForm.hWnd
End Sub

0
 
sb8gqAuthor Commented:
Thanks a lot
0

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now