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

Single Form Application 1

Status
Not open for further replies.

Olaf Doschke

Programmer
Oct 13, 2004
14,847
DE
Hi all,

I thought it's time I also make a FAQ. I think it answers several questions, that all aim to the same goal of creating a single form application. That are questions regarding Read Events/On Shutdown, Top Level Form (SDI instead of MDI), hiding the _Screen and problems with Foxuser.dbf (Resource) and how to use config.fpw.

So here it is, my first FAQ: faq184-6512 (How to make a Single-Form-Application).

Instead of a longwinded text you'll find code that set's up a very simple "hello world"-project (template) for either a SCX or VCX, form, from which one can build up.

Of course I'm open for suggestions and comments.

Bye, Olaf.
 
Olaf,

Good one. This has been asked many times in the past. Glad you were able to put it into words.


Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
ReFox XI (www.mcrgsoftware.com)
 
Hello, I've read and tried to follow the code above about making my SCX singleSCX form work but I must be missing something because I can't figure out how to integrate my screen. I copy and past the code and when I run it I get a project build screen that shows a form called frmmain.scx. How do I get my form to show up in the build.

Thanks for your help and I'm sorry if I'm missing obvious steps here I'm new to VFP 8.

 
Hi MFClima,

I wrote the code just to make a project from scratch and you might then modify frmMain from there. Of course it would be a good point if one could simply add an existing form, eg a form done with a builder or wizard.

But I just made it so I wouldn't have much instructions on what to do, but simply let a skript create the project. It's even shorter than a ZIP-File of the created directories and files. But it wasn't intended to be a project builder tool.


For the begin, don't try to change that code, it generates the project and you can simply copy your SCX/SCT file into it's /form/ subdirectory. Then in the project manager activate the Docs/Documents Tab and click the add button to add your form there.

Then change the main.prg in the Code Tab to start your form instead of frmMain:

Code:
* Do Form frmMain
Do Form yourformnamehere

You need to make sure your form has the same important settings: ShowWindow must be set to 2, Autocenter should be .T. and put the following line into the Unload Event of your form:

Code:
CLEAR EVENTS

To do so, modify the form, then double click on some empty space on the form. You should be in some method of the form or some object of it. choose the form in the object combo and "Unload" in the procedure combo and type in that line.

Then click on build to get the EXE with your form.

Welcome to VFP!

If there are further problems, come back.

Bye, Olaf.
 
I will give that a try.. Thanks again for your help on this..
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top