Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Checkbox in grid
Message
De
01/08/2001 17:59:16
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00538180
Message ID:
00538588
Vues:
11
As Vlad pointed out, it's NewObject() you want since the extra parms for AddObject are the ones passed to the Init() of the object added (unless the object is an ole control).

I wanted to point out that if you want to do both - i.e., add an object by specifying the source file AND pass parameters, NewObject also has the cInApplication parameter that must be delineated. It can be empty, but it has to be delineated. It is not ignored.
AddObject() does have the OLE class parameter before the init parameters, but it is ignored if the object isn't an OLE control.

e.g. say you have textbox that you can pass in the name of the font to use.

Using AddObject:
Set Classlib To myclasslib
thisform.AddObject("txtNew", "mytextbox", "Courier New")
Using NewObject:
thisform.NewObject("txtNew", "mytextbox", "myclasslib", , "Courier New")
>I tried putting in a third param as _cc.vcx for classlib and got no lparameter statement found.
>
>>>In putting a checkbox in a grid column with code, just curious why the docs show 3 or 4 params and the method of the column object has two params, so must you use two? What if you don't want to use a baseclass?
>>>
>>>
>>>TIA
>>
>>It will work with the extra params, just like the function.
>>I guess they don't come up when in the code window because they are 'virtual parameters' that are handled under the hood.
Insanity: Doing the same thing over and over and expecting different results.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform