Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Default Property of an object
Message
De
31/07/2001 09:53:00
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
À
31/07/2001 09:47:06
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00537719
Message ID:
00537729
Vues:
12
AFAIK, in Visual FoxPro, when you write something like ThisForm.MyTextBox, you are always referring to the object itself, not to one of the properties. You always have to specify the property, and a frequent cause of bugs is to confuse "ThisForm.MyTextBox" with "ThisForm.MyTextBox.Value".

OTOH, this syntax can be useful too; there are quite a few things you can do with pointers to objects. For instance, you can pass ThisForm.MyTextBox as a parameter to a function. The function, then, does something with the specified TextBox.

Hilmar.

>>Hi!
>>
>>No. You can define property TextBox, than add object TextBox. Property will return value when Accessing TextBox as object will work with object. Than in the textBox_Assign method you define what to return from TextBox object. But this is with use of the parent container only...
>>
>>>Hi all,
>>>
>>>Is there a way to assign a default property to an object in VFP? In VB, this is possible:
Form.Textbox = Form.Textbox.Text
>>>
>>>Thanks,
>
>I probably mistated my question. In VB you can get the value of the default property of an object without bothering to use the property name:
>
>Example:
>
>dim x as string
>
>' any of the following line of codes is valid
>set x = Form.Textbox
>set x = Form.Textbox.Text
>
>' both will return the value of the default property which is .Text
>
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform