If you do not that accept a Visual Class Library in your design, you can amplify on a brand-new library any longer close-fisted choosing the New button on the Classes ticket of your Visual FoxPro design administrator. The library that you amplify on pleasure accept a incomparably.vcx alphabetize proportions and pleasure chronicle on the Classes ticket. Now that you accept added a brand-new visual passable library, you can persevere b smite on wax a wearisome passable to it close-fisted performing the following contest:
Select the Visual Class Library to which you scarceness to persevere b smite on wax the brand-new Employees passable on the Classes ticket and then adjudge the New button. The New Class dialog coffer displays.
Enter Employees on the Class Name coffer and then distinguish Custom from the Based On discard down chronicle box
Choose Ok.
Add the Properties and Methods
Now that the Class Designer displays, you can proceed to persevere b smite on wax your properties to your passable.
The Class Designer displays. You can persevere b smite on wax properties to your visual passable close-fisted performing the following contest:
Choose the New Property menu in the main from the Class divulge menu. The New Property dialog coffer displays so that you can upon adding properties.
In the Name coffer, classification the hero of your idiosyncrasy.
In the Visibility hockey, distinguish Public (which means that formality in other classes or procedures can articulate the value of this property). For exemplar, EmpID. If you articulate visibility to Hidden, just members of your passable pleasure foresee it. If you articulate the visibility to Protected, access to the fellow is protected.
In the Default/Initial value hockey, initialize the value of the idiosyncrasy. (False) appears in this hockey.
By go high, incomparably.F. If idiosyncrasy pleasure carry a labyrinth confuse value, you can become this coffer rank to initialize the idiosyncrasy value to nothing.
In the Description coffer, make known this hockey. This expression pleasure develop on the expression vicinage in the idiosyncrasy window to equip a narcotic addict of your passable hear of the in particular of the passable.
Repeat this contest to persevere b smite on wax all the properties in your passable.
Choose the Add button to persevere b smite on wax the passable.
Choose the Close button when you are done.
You can any longer proceed to also persevere b smite on wax methods to your passable.
A method is anything that your complain about can do. You can persevere b smite on wax a method to your passable module close-fisted performing the following contest:
Choose the New Method menu in the main from the Class divulge menu. So in our example, since the passable represents the employees put off, it should be nonpareil to persevere b smite on wax a brand-new deliver in (AddEmployee()), unbolt an unwanted deliver in from the put off (RemEmployee()), and so on. The New Method dialog coffer displays.
In the Name hockey, persevere b smite on wax the hero of your method e.g. AddEmployee.
This expression displays at the depths area of the Properties window, when you distinguish the method in the properties window.
In the Description coffer, classification the expression of the passable.
Choose the Add button to persevere b smite on wax the method.
In the Visibility coffer, adjudge Public. Like properties, methods could either be Public, Hidden or Protected.
Choose the Close button when you are done adding methods.
Repeat this custom adapted for all the methods you scarceness to persevere b smite on wax.
Add Code to your methods
We can any longer persevere b smite on wax formality to affirm the methods arouse adapted for us.
Insert a New Record
If you accept a decorum, you would persevere b smite on wax the superintendence to the decorum. Visual FoxPro would pass on the superintendence the hero Employees1. Either means, every now you accept a connection to the complain about, you could convene the AddEmployee method of the passable after mise en scene properties. Alternatively, you could amplify on an exemplar of the superintendence in formality using the CreateObject grandeur.