Re: applying a VCX to an existing form
- From: "Juan Alonso" <john@xxxxxxxxxxx>
- Date: Thu, 12 Jun 2008 10:43:15 -0400
I use the drag and drop method, but you must add the CLASS to your LIBRARY
of Classes.
Here in case you are not familiar with this part of the help file.
From the help file in VFP 8 SP1 + (all hotfixes)
One of the most powerful features of Visual FoxPro is the ability to create
classes that can easily be used and reused in various pieces of your
applications. Once you've created classes, you can add them to your forms.
To add an object based on a custom class
In the Project Manager, drag the class onto the container.
You can also add your classes directly from the Form Controls toolbar when
you add them to your toolbar.
Adding Class Libraries to the Controls Toolbar
You need to register your class libraries before they can be displayed in
the Form Controls toolbar.
To register a class library
From the Tools menu, choose Options.In the Options dialog box, choose the Controls tab.
Choose Add.
In the Open dialog box, choose a class library to add to the Selected list
and choose Open.
Repeat steps 3 and 4 until you've added all the libraries you want to
register.
Classes in the class libraries in the Selected list can be used in the Form
Designer as easily as Visual FoxPro base classes can be used.
Tip If you want the class libraries to be available from the Form Controls
toolbar every time you run Visual FoxPro, choose Set as Default in the
Options dialog box.
You can also register libraries directly in the Form Designer.
To register a class library in the Form Designer
In the Form Controls toolbar, choose the View Classes button.
From the submenu, choose Add.In the Open dialog box, choose a class library to add to the Form Controls
toolbar and choose Open.
Adding Objects to a Form from a Class Library
Once you've added class libraries in the Classes tab of the Options dialog
box or from the View Classes submenu, you can access them in the Form
Designer.
To add a custom object from the Controls toolbar
In the Form Controls toolbar, choose the View Classes button.
From the list of registered class libraries, select the library thatcontains the control you want to add to the form.
The toolbar is populated with the controls in the library you selected.
Click the control you want and drag it to size in the form.
Note You can remove a visual class library from the View Classes toolbar
menu by selecting the library in the Selected list in the Controls tab of
the Options dialog box, and choosing Remove.
When you add objects to a form based on anything other than the Visual
FoxPro base classes, a relative path to the class library (.vcx file) is
stored in the form's .scx file. If you move either the form or the class
library to a different location, Visual FoxPro displays a dialog box when
you try to run the form so that you can manually locate the class library.
Determining What Controls Are on a Form
To determine how many controls are on the form, you can use the ControlCount
property. The Controls[n] property of the form allows you to reference each
control on the form. The following program prints the Name property of all
the controls on the currently active form.
ACTIVATE SCREEN && to print to the main Visual FoxPro window
FOR nCnt = 1 TO Application.ActiveForm.ControlCount
? Application.ActiveForm.Controls[nCnt].Name
ENDFOR
Later,
Johnny.
"Richard M. Sieminski" <rsieminski@xxxxxxxxxx> wrote in message
news:796ce$482c66c4$21413@xxxxxxxxxxxxxxxxxxxx
How do I get a .VCX (specifically, Marcia Akins' GRAPHS.VCX which allows a
form to create a graph using the basic MS Graph engine) on an
already-coded
and working form? It's a multi-page (3) form and I would like to generate
and display a graph onto Page 3. Marcia's sample form works exactly as
advertised, but there is no way I can get her .VCX to migrate over to MY
form. Any help would be greatly appreciated. Thank you in advance.
Rich Sieminski
Gateway Computer Services
Cambridge, ON
** Posted from http://www.teranews.com **
.
- Prev by Date: Re: Grid event code content disappears after recordsource changed
- Next by Date: Window Property
- Previous by thread: Re: Grid event code content disappears after recordsource changed
- Next by thread: Window Property
- Index(es):
Relevant Pages
|