Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. sponsors. rss.
 From: Eric den Doop
  Where is Eric den Doop?
 Houten
 Netherlands
 Eric den Doop
 To: kulwant singh
  Where is kulwant singh?
 Shimla
 India
 kulwant singh
 Tags
Subject: RE: Forms through Code
Thread ID: 119232 Message ID: 119235 # Views: 72 # Ratings: 2
Version: Visual FoxPro 6 Category: Forms
Date: Sunday, January 21, 2007 9:44:05 AM         
   


> Dear Experts,
> With your help and advice I am making good progress in VFP. Thanks!
>
> I wish to create form through code.
> Where do we put this code? Do I use 'Modify Command' in the command window? But that will create a PRG.
> How do create a SCX and SCT through code ?
>
> kulwant

Here's a basic sample.

CREATE FORM myform NOWAIT
ASELOBJ(laObj,1) && get a reference to the new form 
laObj[1].Caption="Hello World"
laObj[1].AddObject("cmdTest", "CommandButton") && add button
laObj[1].cmdTest.caption = "Click Me"
laObj[1].cmdTest.WriteMethod("Click", "MESSAGEBOX('Hello World')") && write Click event
KEYBOARD '{CTRL+W}' && save and close
DO FORM myform

--
Eric den Doop
www.foxite.com - The Home Of The Visual FoxPro Experts



COMPLETE THREAD
Forms through Code Posted by kulwant singh @ 1/21/2007 8:34:13 AM
RE: Forms through Code Posted by Eric den Doop @ 1/21/2007 9:44:05 AM
RE: Forms through Code Posted by kulwant singh @ 1/21/2007 11:23:01 AM
RE: Forms through Code Posted by Eric den Doop @ 1/21/2007 12:37:42 PM
RE: Forms through Code Posted by Dragan Nedeljkovich @ 1/24/2007 5:49:11 AM
RE: Forms through Code Posted by Borislav Borissov @ 1/21/2007 9:54:40 AM
RE: Forms through Code Posted by kulwant singh @ 1/21/2007 11:49:10 AM
RE: Forms through Code Posted by Borislav Borissov @ 1/21/2007 11:52:32 AM
RE: Forms through Code Posted by Christof Wollenhaupt @ 1/22/2007 7:07:26 AM
RE: Forms through Code Posted by Barbara Peisch @ 1/23/2007 11:48:50 PM