Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How disappointed I am .
Message
From
05/02/2002 06:37:16
 
 
To
05/02/2002 03:22:24
Max Chen
Yx Software
Shunde, China
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00615259
Message ID:
00615320
Views:
27
Hi!

It is a limitation of VFP that could not be avoided. You CAN add a property or method in design time to some object inside of the form, but it is not supported by VFP and as a result is lost when next time form edited or does not works in run-time properly.

You can use another approach that is much better. Just create a class for that button where you add a new property and a new method. Then use that class to put button on the form. You can use that button on any otehr form and it will still have both property and method, so that button's behavior is the same for all forms.


>*- the following codes try to add property and method for a command button
>aSelObj(aArray)
>o=aArray(1) && store a reference of a command button in form designer
>o.AddProperty('test_p','1')
>o.WriteMethod('test_m',"? ok ",.t.) &&the .t. means create new method
>
>Ok, it seems ok, the property inspect window shows what i had added,
>the new property and the new method. Then open the scx file by a use,
>what i add is there.
>
>Great, i think i can write a short routine to add properties and
>methods for objects containing in a form on design time. My code will
>be more good...
>
>
>But....
>
>When i run the form, only the new method of command button can be access,
>the property missed.
>And after serveral time of open the form in designer, the two gone !
>
>Mr. Ken Levy, do please add this feather in toledo.
>
>
>AND, anybody can tell me how to hack in the fox to accomplish that in vfp7 ?
>
>TIA.
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.com
ICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs

It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform