MDI Forms

T

Tony K

How do you maximize a child form when you show the child form. My
resolution on my screen is 1440 x 900. My parent form maximizes just fine,
but when I show a child form it doesn't maximize. It doesn't separate
itself from the child form, meaning you can't move it around like if the
form was "restored" but it doesn't take up all the space available.

I do not have the maximum or minimum size set in the properties, but I do
have the WindowState set to Maximized. I also have the size property set to
800 x 600 and that is the size that the form starts up as.

Any answers would be greatly appreciated.

Thanks, Tony
 
M

Miro

This happend to me....
Are you using the Property to maximize? or doing it by code?

If you notice, it is actually showing you the form the exact size it is in
development mode.

Try to show the form maximized thru code

fMain = New frmMain
fMain.WindowState = FormWindowState.Maximized
fMain.Show()
and leave the windowstate "Normal" on the property of the form.

Compile...
it should work,

Now if you get rid of the code, and change your property back to show
"maximized" it should work.

After I ran into this...i always show all my forms maximized thru code (
like above ) and leave all my forms "Normal", and it has never happend
since.


Lemmi know if this fixed you as well. Im sure others will run into this
too.

Miro
 
T

Tony K

You are the MAN!! Thank you Miro. I have struggled with this on other MDI
apps and went about it a much LONGER way. Thanks again.

Tony
 
G

Garry

Look down the list of posts to My.Application.OpenForms on 14th Dec to see
some material about resizing MDI children etc.
Stephanie showd me how to do it and leaving a MDI child maximised does not
utilize the facilities available for an MDI application.
The user cannot resize the forms to show them side by side if they are
maximised - if he wants to.
He may not even realise that there are other MDI children displayed 'under'
the one he is looking at.
My problem was to generate the MDI child so that it filled the available
space without being docked or maximised.

Garry
 
M

Miro

A soon as I seen your question, I realized you had the same nightmare I ran
into.

I am slowely teaching myself VB.net and I - for the life of me, couldnt
figure out what I had done wrong. Seems it wasnt me at all !!! :)

I am not sure if the same thing happens on non "MDI" apps, but I dont risk
it anymore. I keep all my apps as "Normal", and
set it during code at runtime.

Glad to be of help.
Cheers

Miro
 
M

Miro

This is fine, but that is not what actually happens in this 'bug'.

What will happen, is that your form will show in your MDI as "Normal" but it
is actually 'Maximized'.
Very hard to explain. You will see the other forms underneith it, but you
wont be able to click on them, until you actually re-click on the maximize
button on the form you displayed and then unmaximize it.

I understand your "window example", but I ran into this trying to create an
app that looked like "Quickbooks" where I handle all the windows, but they
are always all in maximized Mode.

Miro
 
G

Garry

Miro,

If you are answering me then the MDI children that I generate are free to
move as the user may wish.
It is just that my initial condition on child form generation was to fill
the available area in the MDI parent form and it was very difficult to find
the correct width and height before the form is shown without causing the
'ClientRectangle' to display scroll bars at the side of the parent and in
some cases, cascade multiple forms.
My MDIChild forms now behave exactly as I want and they are not maximised
and do not appear anywhere as maximised. But, they are maximisable.
However, it was much simpler in VB6. I have had to repeat this a lot
recently.
So much for the vaunted 'You write less code in VB2005'.

Garry
 
M

Miro

Sorry,
I was replying to this portion:
and did not fully read this portoin:
The issue Tony K ran into is when you want to display the initial form
Maximized off the start.
It works, it works, it works and then suddenly one compile it stops working
and does the "described" funny stuff.

Sorry,

Miro
 
T

Tony K

I read your posts back and forth from Garry and you and I fully understand
where Garry is coming from. But, my problem is what you helped me fix. The
user can still "RESTORE" the child window and see other child windows behind
them, they can resize them, but the kind of app I'm making they will not
have a use for seeing multiple windows. If they want to see which child
windows they have open, they will have to click on the "Window" menu item
and see the open windows.

Thank you again for helping me with that problem. It worked GREAT!!!

Tony K.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top