Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Drop class on form and execute code
Message
From
17/01/2001 14:37:52
 
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00463901
Message ID:
00464844
Views:
20
>Hi!
>
>Don;t be too happy, I just tried to experiment more with that and figured out that first time you put control onto the form it works. But second time you place the same control it does not fire at all. It looks like it caches the class definition in the memory and do not recalculate values of properties. Its sad. Looks like you need to turn back to the suggestion about use of class builder functionality, unless you do not require exact reliability of your hook procedure.
>

One time probably won't cause me any problems as I really will only have one instance of this control on a form. I'm not 100% positive I'll even have this as a control that needs to be dropped on a form, but that's the way I'm currently leaning.

>>>One more note:
>>>Together with "set procedure" command to make hood routine accessible you require to use 'set classlib' command to the class library with classes that contain such tricky functionality. Without 'SET classlib' this will not always work.
>>>
>>>>Hi!
>>>>
>>>>I know answer, but it could be organized by some weird tricky way.
>>>>I made following:
>>>>
>>>>procedure DesignHook
>>>>lparameters poObject
>>>>= messagebox("Hello!")
>>>>return ""
>>>>
>>>>
>>>>Than made a label class. In the Tag property instead of usual value I put following:
>>>>= DesignHook(this)
>>>>When you use 'set procedure to' command to setup above code in procedure to be always accessable,
>>>>DesignHook will be ran each time you place such control to form. You can use also thisform to reference a form design object. It is quite intereting and I was very confused what is hidden after thisform object in design time, specially when you edit class? (thisform returns correct reference into hook procedure when you edit above class and use described way). Is this a reference to a wrapper form that contains edited class? I never investigated these questions so deep, but at least you have an easy way to run a code for new placed control and even pass a reference to the objects into it.
>>>>
>>
>>
>>With a little tweaking, I may be able to make this do exactly what I want. I wonder why I can't make a reference to itself (ie: "=this.DesignHook()") with a local method DesignHook. It just seems to ignore that, but it does run an external function.
>>
>>Thanks Vlad!
Fred
Microsoft Visual FoxPro MVP

foxcentral.net
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform