|
-
Jul 7th, 2004, 01:59 PM
#1
Thread Starter
Junior Member
MDI behavior is strange. please help
Is there away to prevent an MDI child form from being auto maximized?
The problem I have is this. I have an mdi application that contains 2 mdi child forms. When I show the first form and maximize it so that it fills the mdi window I can't load the second form non maximized.
Vb.net automatically maximizes the second form despite the fact that I didn't tell it too! If I then restore the second form to its normal size it then does the same with the first form. This is all very strange to me. When you maximize one form inside an MDI window it maximizes them all. how do you stop this from happening?
What I want is the first form to stay maximized and the second for to appear on top not maximized.
here is the code I'm using to display the second form (the one I don't want to be maximized)
I'm loading this form from the menu so 'ME' is the MDI Parent form
Dim frm As frm2
frm = New frm2
frm.MdiParent = Me
frm.Show()
When I click on the menu and execute the code above I have the first form maximized. I don't want this to happen. I want frm2 to appear inside the MDI form and I don't want it to be maximized.
I've tried changing the window style but that dosn't work either. I also don't want to call frm2.ShowDialog() because it makes the form appear outside the MDI window.
-
Jul 7th, 2004, 02:02 PM
#2
Hi.
I'm afraid this is normal windows behaviour, and there's probably nothing to do about it.
You will see the same behaviour in all other MDI app's like Excel, Word and the like.
Maybe some fancy API, but that's beyond me.
Sorry.
I wish I could think of something witty to put in my sig...
...Currently using VS2013...
-
Jul 7th, 2004, 05:35 PM
#3
Hyperactive Member
As pax explained, the behavior is normal for all windows applications that use an MDI interface. You could get around this by not making the form you want to appear as normal, not an MDI child.
Whadayamean it doesn't work....
It works fine on my machine!

-
Jul 8th, 2004, 05:30 AM
#4
PowerPoster
Hi,
"What I want is the first form to stay maximized and the second for to appear on top not maximized. "
You could reset the sizes of the child forms to achieve this effect as required and not use maximise.
Taxes
The more I learn about VB.NET the more I like dBaseIII Plus
The foregoing, whilst believed to be correct, is given without guarantee as to it's accuracy and entirely without recourse. You are required to decide for yourself whether or not it is suitable for your purposes and no liability for loss of any nature can be entertained.
-
Jul 8th, 2004, 09:23 AM
#5
Fanatic Member
cant you just set maximized size property???? not 100% sure but would it be the case that the max size is 100x100 if perant forms i maximised then it will only show child at max size
I am curretly building a defect management system for software and web developers,
If you wana try it out (beta test) and keep it for free just send me a message
-
Jul 8th, 2004, 10:19 AM
#6
Hyperactive Member
Well, three solutions have been offered, lets see what our friend who posted this question has to say about them. So tell us Kevin, what do you think?
Whadayamean it doesn't work....
It works fine on my machine!

-
May 18th, 2009, 10:22 AM
#7
Fanatic Member
Re: MDI behavior is strange. please help
As far as i am aware, the data in this thread is in correct. The form can be set to not maximize on MDI child form load. As i have two programs that do not maximize the forms
here is some ideas.. Be sure on the form your loading that the .WindowState property is not set to maximized, in the property section for the form as well as in the formload section.. as well as to where you call the form to be loaded.
-
May 18th, 2009, 10:57 AM
#8
Re: MDI behavior is strange. please help
@TheUsed: The problem is, regardless of the settings on the form at design-time, if the user clicks the "maximize" button in the MDI child form's title bar and maximizes it, then opens any new MDI child, that newly opened child will also be maximized. As far as I know, this is the behavior of all standard MDI applications.
-
May 18th, 2009, 12:17 PM
#9
Re: MDI behavior is strange. please help
@00Kevin - this is standard, normal, expected behaviour of MDI windows....
@cyberHawk - true, but then that means the form isn't contained in the MDI Parent, and can be moved outside the confines of the app.... may or may not be what you want.
@taxes - that's probably the way I'd go with it.... on the form resize event, check the WindowState property and if it's been set to maximize, reset it to "normal" and then (using the .Move method) resize the form so that its width and height match that of the MDI Parent client window area.
@carlblanchard -as nice as it sounds... there's no such thing as a MaxWidth or a Max Height property... wish it were that easy.
-tg
-
May 22nd, 2009, 09:33 AM
#10
Fanatic Member
Re: MDI behavior is strange. please help
oh! okay yeah, I will have to agree with that being the standard.
Thank you for that clearification
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|