Solved

Preventing resize of MDI Child forms

Posted on 2002-06-06
11
516 Views
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.
0
Comment
Question by:sarankrishna
11 Comments
 
LVL 6

Expert Comment

by:manch
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.

Manish
0
 

Author Comment

by:sarankrishna
ID: 7061068
manish,

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

Expert Comment

by:Anthony Perkins
ID: 7062564
manch,

Welcome to EE!  Please re-read the EE Guidelines (http://www.experts-exchange.com/jsp/cmtyQuestAnswer.jsp) regarding locking questions with answers.  Typically here we post solutions as comments.

Thanks,
Anthony
0
 
LVL 3

Expert Comment

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

Author Comment

by:sarankrishna
ID: 7064032
No I want a MDI Child only
0
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 
LVL 5

Expert Comment

by:bob_online
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.
0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 7070063
sarankrishna,

You may want to re-read the EE Guidelines (http://www.experts-exchange.com/jsp/cmtyQuestAnswer.jsp)regarding maintaing your open questions.  

Experts,
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  
http://www.experts-exchange.com/jsp/qShow.jsp?ta=crystal&qid=20193727
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  
http://www.experts-exchange.com/jsp/qShow.jsp?ta=visualbasic&qid=20187322
Configuring Exchange Server Mailing System Date: 02/01/2001 06:03AM PST
http://www.experts-exchange.com/jsp/qShow.jsp?ta=winntnet&qid=20067827

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

Anthony
0
 
LVL 2

Accepted Solution

by:
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
0
 
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?

Anthony
0
 
LVL 49

Expert Comment

by:DanRollins
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
0
 
LVL 1

Expert Comment

by:Computer101
ID: 8092460
Comment from expert accepted as answer

Computer101
E-E Admin
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
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…

744 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now