Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to do forms through .prg files and in forms?
Message
From
25/05/2001 15:57:00
David Fluker
NGIT - Centers For Disease Control
Decatur, Georgia, United States
 
 
To
25/05/2001 14:58:29
Kishor K
KPIT Cummins Infosystems Ltd.
Pune, India
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00511673
Message ID:
00511694
Views:
15
Here are some brief answers to get you going. You can find more details in the FAQ section of the UT and in the VFP and MSDN help. And I'm sure others will jump in and add more detail.

>Please help me on the following :
>
>1. How do i launch a form in .prg files? I did the following :
> do form SomeFormName
> read events
> *its not returning from the form
> *i mean the following is not printing even
> *after the form is closed with
> *close button.
> ?'Wont be prnited'

Add "CLEAR EVENTS" when you close your form. Think of a FP2.x foundation read -- "READ VALID lQuit" When you wanted to end the app you set lQuit to .T. and issued a CLEAR READ. Now all you have to do is CLEAR EVENTS
Usually you will have a main program that issues the READ EVENTS and a menu choice that quits the app by issuing a CLEAR EVENTS


>2. How do i launch a form from withing another form?
> Like the following is in click event of a button on form :
>
> procedure click
> *
> * some code to validate user
> *
> if UserValid
> release thisform
> do form TheNextDesiredForm && is this how am i to launch a form?
> read events && need help on this.
> else
> * invalid user error message
> endif
>
> my question is, how do i launch the next desired form in the
> uservalid module?

You can run a modal form with this code. The calling form will release when you close the second form. You don't need the READ EVENTS. You can't release the calling form because when the form is destroyed, the object that is the new form will go out of scope and be gone. I'll let someone else answer this because I don't have much time.


>4. how do i hide the foxpro screen and give my forms the whole control?
Add SCREEN=OFF to your FoxPro.fpw and the Fox screen will not appear.
Make your form a Top-Level form and it will live in the desktop.
Check the UT FAQs and the FOX help files form more info.

>3. how do i add menu to any form? can i not add menu to anyform?
You can add a menu to a top level form.
- In the menu designer genaral options, set the the menu to top level menu
- Run the menu from the init of the form DO menu.mpr WITH (This)
There are more detailed instructions in the Fox help files.

You might considering purchasing a VFP framework that will help you deal with these and other VFP issues simply and let you concentrate on your application.
David.
Previous
Reply
Map
View

Click here to load this message in the networking platform