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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

adjusting a form size on initialization with resize 1

Status
Not open for further replies.

markftwain

Technical User
Jul 12, 2006
108
Hi,

Is there a "best" way to force a form to "resize" itself to maximum screen display size on initialization when using mwResize50?

My setup is:
Windows 7, vfp9
a parent form "as top-level form" in which user calls other forms with ShowWindow "in top-level form".

My goal would is to have the "top-level form" act as a desktop with control positions managed by mwResize. All child forms are to maximize to the size of the top-level form with their control positions also managed by mwResize on their initialization.

Thank you much
 
Yes and no.

Setting WindowState to 2 does enlarge the top-most screen to the full display. However, the 'resize' event seems not to be called. Thus the controlls are not being moved relative to the maximized window size. (Calling "resize" explicitly in the form initialization does not help either).

On the other hand, if I start with a "normal" window and manually drag the window edges, the controls do correctly position themselves.

Ideas?

Thanks
 
Setting WindowState to 2 does enlarge the top-most screen to the full display. However, the 'resize' event seems not to be called.

That's not what I would expect. Setting WindowState to 2 should trigger the form's Resize.

Where are you setting WindowState? You might need to do it programmatically, in the Init event, rather than at design time.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips, training, consultancy
 
If you're working with mwResize, take a look at it's documentation in the zz_Readme() method mentioned in the reame.txt:

If you want a form to be initially maximized setting WindowState=2 in
design will not resize the controls on your form. Instead add this code
to the form's show event:

... code ...

Bye, Olaf.
 
As well written as mwResize is, I guessed I missed something. Thank you.
 
Just a followup note.

mwResize50 worked great on the same machine as the exe file. But when networked through remoteApp, shrank the font and screen size to be nearly unusable..Oh Well, good try.

 
That can be the case, if wrong dimensions are stored into foxuser. Don't use that feature of mwresize like done in the sample form, especially in a networked EXE with one foxuser for all users.

Also, why not change start to a bat file copying the app from a network drive via XCOPY of all files newer than local (or missing local), this takes a bit time only once and also gives less problems with concurrent usage of the program. And you still have just one central folder to deplay the app to the LAN.

Bye, Olaf.
 
Also, what's important: You use the code given in the zz_Readme() method instead of setting the form to WindowState=2, not additionally.

Bye, Olaf.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top