Preventing resize of MDI Child forms

Posted on 2002-06-06
Last Modified: 2008-03-17
In my visual basic application , I have lot of MDI Child form. Out of all the MDI Child form , one MDI child form is always in the open state. My problem is that form is getting resized when the other MDI child form resized(minimize,maximize,restored). I want that one MDI child form should not get resized automatically.
Question by:sarankrishna

Expert Comment

ID: 7061008
Hi Sarakrishna,

To prevent the resizing of MDI Child Forms
just change the one property of the MDI Child Forms

That Property is BorderStyle ( Change it to FixedDialog or any of the FixedBorder Style )

Now the user will not be able to resize the MDI Child Forms.


Author Comment

ID: 7061068

my problme is if I restore one MDI child form other child form geting resized automatically. I want to allow only manual resize
LVL 75

Expert Comment

by:Anthony Perkins
ID: 7062564

Welcome to EE!  Please re-read the EE Guidelines ( regarding locking questions with answers.  Typically here we post solutions as comments.

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.


Expert Comment

ID: 7064021
Can't U just make it a separate form (Not MDI CHILD!!!)

Author Comment

ID: 7064032
No I want a MDI Child only

Expert Comment

ID: 7069874
Its not easy, especially if you want the user to be able to manually resize it.

1)  Add a picturebox control to the mdi form.  In the resize event of the mdi, size the picturebox to fill the entire area of the mdi.
2)  declare the SetParent api:

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

3)  set the parent of your mdi child to the picture box.

SetParent NameOfChildForm.hWnd, Me.Picture1.hWnd

The above line assumes the code is in the mdi form somewhere, hence the Me.Picture1.

4)  Since the child is now owned by the picture box, the normal resize stuff that happens automatically in an mdi no longer affect it.
LVL 75

Expert Comment

by:Anthony Perkins
ID: 7070063

You may want to re-read the EE Guidelines ( maintaing your open questions.  

For the record none of sarankrishna's questions have been closed:
Questions Asked 6
Last 10 Grades Given  
Question Grading Record 0 Answers Graded / 0 Answers Received
Dynamic  image Loading.... Date: 10/16/2001 05:30AM PST
How to fix OSD-04101 ORACLE problem... Date: 09/24/2001 10:32AM PST
How to Retain the check box value in Treeview control Date: 09/24/2001 08:35PM PST
Configuring Exchange Server Mailing System Date: 02/01/2001 06:03AM PST

You can judge for yourself, whether it is worth your while to pursue any further.


Accepted Solution

AndySulz earned 300 total points
ID: 7071150
add this

private sub form_resize()
  on error resume next
  height = 1343' or what ever you want the height to be
  width = 23433 ' ""                       width    ""
end sub
LVL 75

Expert Comment

by:Anthony Perkins
ID: 7076861
Do you need help maintaining your open questions or do you choose not to close them?

LVL 49

Expert Comment

ID: 7858191
Hi sarankrishna,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will ask a Community Support Moderator to:

    Accept AndySulz's comment(s) as an answer.

sarankrishna, if you think your question was not answered at all or if you need help, just post a new comment here; Community Support will help you.  DO NOT accept this comment as an answer.

EXPERTS: If you disagree with that recommendation, please post an explanatory comment.
DanRollins -- EE database cleanup volunteer

Expert Comment

ID: 8092460
Comment from expert accepted as answer

E-E Admin

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
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…

772 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