?
Solved

Can 2 MDIChild forms be opened without effecting each other.

Posted on 2001-08-16
3
Medium Priority
?
284 Views
Last Modified: 2010-05-02
I am trying to have to MDIChild forms open at the same time without effecting the Windowstate of the other.  One needs to stay maximized while the other is opened in a Normal state. Can this be done? If so, how?
0
Comment
Question by:joesmow
[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
3 Comments
 
LVL 3

Expert Comment

by:Bahnass
ID: 6395194
I think No if One is maxmized
But U can make it as if it is maximized
(width & Height of MDI )

Waiting 4 Experts
0
 
LVL 2

Accepted Solution

by:
PeteD earned 200 total points
ID: 6395242
'if you set the mdichild property of Form2 = false
Option Explicit
Private Declare Function SetParent Lib "user32" (ByVal hWndChild As Long, ByVal hWndNewParent As Long) As Long

Private Sub MDIForm_Load()
    Form1.Show
    Form1.WindowState = vbMaximized
    Form2.Show 0
    SetParent Form2.hWnd, hWnd
End Sub
0
 
LVL 43

Expert Comment

by:TimCottee
ID: 6396165
joesmow, the simple answer is no, the complex answer is maybe.

No: the MDI rules are that if any window is maximized, you effectively maximize any non-minimized windows at the same time, i.e. only one window can be maximized at a time in the MDI parent.

Maybe: PeteD's code would work to give you a simulation of this, however the SetParent call does not truly make the window into an MDIChild so whilst it will to some extent appear to be a child window you would have to add additional checking such as the window position within the MDI form to display/turn off scroll bars etc as these will not necessarily work properly.

I don't understand your specific reasons for wanting this, generally speaking I only use this kind of thing when displaying a modal form as a dialog or warning etc. Then I make this form a non-MDIChild and centre it over the MDI form. I generally prefer to stick within the MDI framework and modify my design rather than have to handle pseudo-MDIChildren in this way.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
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 process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…
Suggested Courses

649 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