Solved

Dynamic Objects

Posted on 1998-08-25
4
165 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

738 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