Solved

Dynamic Objects

Posted on 1998-08-25
4
163 Views
Last Modified: 2012-05-04
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
Comment
Question by:sb8gq
  • 2
4 Comments
 
LVL 1

Expert Comment

by:brunchey
ID: 1430911
what code are you currently attempting to use to do this?  
how about...


Dim myfrm as new baseform

myfrm.show


0
 
LVL 1

Accepted Solution

by:
raygibbins earned 70 total points
ID: 1430912
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
 
LVL 1

Expert Comment

by:raygibbins
ID: 1430913
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
 
LVL 1

Author Comment

by:sb8gq
ID: 1430914
Thanks a lot
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question