Re: applying a VCX to an existing form

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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 that
contains 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 **


.



Relevant Pages

  • Re: Any .Net controls youd recommend?
    ... >haven't found a plethora of great controls or class libraries (like I had ... I'm looking for controls that you ... Visual Basic 6 programmers were only the ... Express has the best site/service but ComponentOne has the grids I like ...
    (microsoft.public.dotnet.general)
  • Re: "Could not locate some objects...."
    ... >> laptop and then register it? ... > controls, you can find the library name as follows:- ... > you have on the desktop and make those libraries available on your laptop. ... > Then register them, if necessary. ...
    (microsoft.public.excel.programming)
  • Re: Win32 API Wraper library?
    ... easy way to make custom controls easily. ... If you can't understand MFC, you won't understand any other library. ... easiest wrapper libraries to work with (at least until ...
    (microsoft.public.win32.programmer.ui)
  • Re: Ronny Raygun Library has Alzheimers
    ... An audit completed last month by the National Archives and Records Administration's inspector general looked at the management of presidential artifacts at six presidential libraries. ... A "significant breakdown in internal controls" was found at the Reagan library, in Simi Valley, California, he said in a statement Thursday. ...
    (alt.politics.bush)
  • Re: DLL files
    ... I am sure it is to do with missing library files, ... Visual FoxPro executables require the VFP runtime libraries. ...
    (microsoft.public.fox.helpwanted)