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

Problem with running a form from a custom-created menu

Status
Not open for further replies.

Ducu

Programmer
Oct 2, 2003
30
RO
Hi,

I've created a menu using the wizard in VFP. One of the option contains a command: DO myprg.prg
In myprg.prg I've created my form using

frmMyForm = CREATEOBJECT('Form')

along with the inside objects with

frmMyForm.AddObject('txtlcNumSrch','TextBox')

after I instantiate the objects in order to run the form I have something like this:

frmMyForm.SHOW
READ EVENTS

The myprg.prg program runs fine alone, but when I use the menu by do menu1.mpr and try to run the myprg.prg program from the menu the form does not appear on the screen, just a very fast change on the screen.

What I should do to make my program runable from the menu
 
try
Code:
frmMyForm.SHOW(1)
READ EVENTS


Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Hi,

Thanks for your tip it works fine, except that I cannot get out from the form. I have an exit button with the method click containing: CLEAR EVENTS but now I need another command to exit the form. So, my question now is how I can exit the form in this case ?

Thanks in advance



 

Code:
Thisform.Release 
CLEAR EVENTS

Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Thank you again! It works fine now !
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top