Solved

Can 2 MDIChild forms be opened without effecting each other.

Posted on 2001-08-16
3
280 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 50 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

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

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
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 Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

730 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