Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Changing a property at runtime
Message
From
13/11/2004 11:12:19
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
13/11/2004 10:59:37
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Environment versions
Visual FoxPro:
VFP 7 SP1
OS:
Windows XP SP1
Database:
Visual FoxPro
Miscellaneous
Thread ID:
00961048
Message ID:
00961159
Views:
24
>>Methinks you can still save the name of the image control in a property. For example, in some property (for an example, I will use a form property, .oImageControl), save the value: "ThisForm.CntMyClass.Image1", if that is where the image will be accessed.
>
>I see it should be done at design time. I will have to change all my forms and controls that reffers to commands properties. What if a control, p.e. a checkbox, has something like this:
Thisform.Command1.Visible = This.Value
??. I will have to change this code, won't I?. It is desirable just to add the image class at runtime without making any changes to the existing code

I suppose the "Visible" part was just an example for possibly much more elaborate code. (Because in this particular case, you can change it directly,without a method.)

In the Image class, you can define a method to do anything. For example, to change the .Visible property:
* Method ImageClass.ChangeVisible
lparameters lVisible
This.Visible = lVisible
And to call this from outside:
loImage = eval(...) && as before
loImage.ChangeVisible(.T.)
...
loImage.ChangeVisible(.F.)
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)
Previous
Reply
Map
View

Click here to load this message in the networking platform