|
-
March 11th, 1999, 02:13 PM
#1
Forms come up with the wrong size!
Greetings.
I have an MDI application. In design mode, my forms are all the size that I specify. When I create an instance of the form, then set its visible property to TRUE, the form comes up much larger than I specify.
What causes this?
-
March 12th, 1999, 04:51 AM
#2
Re: Forms come up with the wrong size!
Hi
This is standard behavior due to the MDI framework. You'll need to size your form on the Activate or Load event - or make it non-sizable.
Regards
Chris Eastwood
CodeGuru - the website for developers
http://www.codeguru.com/vb
-
March 12th, 1999, 03:02 PM
#3
Re: Forms come up with the wrong size!
Thanks. Right after I received your response I found an entry in MSDN that verified what you said. I guess the question now becomes...
Is there any way to know how windows will size an MDI child form before it comes up?
By the way, thanks for your help.
-
August 27th, 1999, 01:20 PM
#4
Re: Forms come up with the wrong size!
Put your resizing code in the resize method of the form.
This method is called whenever the form is created, resized, minimized or maximized.
-
August 27th, 1999, 09:52 PM
#5
Re: Forms come up with the wrong size!
You can set the AutoShowChildren property to False, so that when a child form is loaded, it will not automatically show. You can then set the chilf Form size explicitely if you want in the MDI form code (after child form load)
May be you can use GetClientRect api call to get the MDI client size and position your child form accordingly.
In the Child form code:
you can use the Form_Resize event to set the size, to a predefined size.
Form_Activate also can be used with a static variable, so that only first time the size is set.
Form_Load is the best, ofcourse.
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
|