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

add SCX to VCX

Status
Not open for further replies.

lardecristo

Programmer
Sep 8, 2012
9
BR
Hi, all

I made a form, but now I need insert in my VCX.
Any ideas??... :)
 
with the form open (in the form designer) you can go to 'file' in the menu and 'save as class'.

and you get to pick your class name and class library.

but there are two different ways of running a form;

you can just keep the form as an .scx and call it using

Code:
do form myform.scx

as opposed to saving as a class and calling it like this

Code:
loFrm = newobject("myform","myclasslib.vcx")
loFrm.show()


there are good reasons to use the class approach but it's not necessary.

hth

n

 
In addition to what Nigel has told you ....

Once you have made the form into a class, you can create new forms based on that class:

[tt]CREATE FORM FormName AS cClassName FROM cClassLibraryName[/tt]

This is one of the main reasons to use form classes.

Another way to do this is to set the class as a "template class". Go to Tools -> Options -> Forms; tick the Form checkbox; and navigate to the class (ignore the "Form set" checkbox). Then, all new forms will be based on that class by default.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top