StrataFrame Forum

Manage Form Size since form's creation

http://forum.strataframe.net/Topic18229.aspx

By Edhy Rijo - 7/30/2008

Hi all,

In Visual FoxPro, when creating a form you can set the Maximum design area to the size of the target screen where the form will be used like (800x600, 1024x768, 1152x882, etc.)  that will show a white box with the preset size selected.

Is there a something like that in VS2008?  if not, what would be the best way to create forms with a size targeted to specific screen resolution and then allow the end user to resize those form if they have a bigger resolution?

Thanks.

By Greg McGuffey - 7/30/2008

That's pretty cool! I don't know of anyway to do this with VS. I just take a guess, then run the app at the desired resolution and see if it works. After a while I just sort of know how big is too big (or too small). I'll be interested in what others do.
By Trent L. Taylor - 7/30/2008

You will just want to set the minimum size of your base dialog to whatever size you want to develop for.  This way you cannot make it smaller than that size.  However, you can leave the MaximumSize alone so that the dialog can be scaled to whatever size.  We created custom templates for our dialogs so that when we create them, they are already the correct size to develop on.  It actually is better in the long run than VFP...that feature generally caused me more problems than do me favors.  In any case, this is the approach we take.
By Edhy Rijo - 7/30/2008

Thanks Greg, Trent.

We created custom templates for our dialogs so that when we create them, they are already the correct size to develop on.

Trent if you don't mind, can you provide the steps to create such a template?  I believe it may be like creating the base form class, but honestly I really don't know where to start in order to create a form template which is what I really need.

By Trent L. Taylor - 7/30/2008

You can actually find a lot of samples out on the web showing how to create templates.  Here is a decent article that I found close to the top of the list when I did a search: http://codebetter.com/blogs/david.hayden/archive/2005/11/06/134343.aspx .  It isn't a great sample, but it covers the basics. 

The bottom line is that you create the classes just as you would like them inside of VS and everything.  Then you ultimately just create a ZIP package with a vstemplate file...and that is pretty much it.  You will use the "$command$" items as replacement characters for replacing the class name, etc.  If you don't get it going, then let me know.  Smile