Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

windowstate problem

Status
Not open for further replies.

wigwug

Programmer
Feb 13, 2005
35
US
I have a top level form that is maximized (windowstate = 2)
_Screen is hidden.

Why won't the child forms that I open in my top level form open maximized if I set their windowstate = 2?

The child form is modeless. I have to set the windowstate manually to 2 but this flashes the screen and does not look professional.

Thanks

 
wigwug,

You said you have to set the windowstate manually. Do you mean you are setting it when you run the child form from the top-level one? If so, are you unable to set it at the design stage? If you need to set it when you run the form, how (& with what method) are you doing that?

What setting do you have for the ShowWindow property in the child forms?


Hope that helps,

Stewart
PS If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Sorry for the ambiguity...

I set the forms window state to 2 (maximized) in the child form. MDI form is also set to true. When called from the parent form it does not fill the parent, i.e. the title bar is under the parent title bar. I then, (in code) set the child windowstate to 2. The screen then flashes and maximizes the child into the parent properly. I would like the child form to do this automaticaly when started.

Thanks
 
Wigwug,

I'm not clear exactly where you are setting the child form's Windowstate. The obvious place to do it would be either the Load or the Init of the child form, because at those points the form is still invisible. Is that what you are doing?

If not, perhaps you could post your code (but strip out any non-relevant parts first).

Mike



__________________________________
Mike Lewis (Edinburgh, Scotland)

My sites:
Visual FoxPro (www.ml-consult.demon.co.uk)
Crystal Reports (www.ml-crystal.com)
 
Thanks all for the advice, but I have tried that:

The code is simple, in the load event of the child form the code is

THIS.WindowState = 2

I have tried it also in the Init event yet it does not maximize the screen into the calling parent form?

The parent and child form are both Modeless but making the child Modal don't work either (not the behavior that I am looking for anyway).

What the H#$% am I doing wrong?
 
Wigwug,

I agree with Mike that the ShowWindow property is important.

Unlike Mike :), I think it should be 2 As Top-Level form. I think if it is 1 then you would actually get the affect you have, with the title bar of the child form just below that of the calling form.

If you make it 2, then it will cover the calling form. You'll also see it in the Windows TaskBar at the bottom of the screen, although I think there is a property you can set to prevent that.


Hope that helps,

Stewart
PS If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top