Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Two problems when dealing with container based classes
Message
From
19/12/2002 10:23:06
 
 
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00734115
Message ID:
00734487
Views:
19
Hi Michelle.

>When I make client subclasses, I'd like the inside controls to be based on the subclassed controls.

The only other solution I can think of (besides hacking the VCX as Paul suggested) is to instantiate the controls at runtime. That means you don't get a visual design surface because you have to set the Top, Left, Height, and Width properties of the controls manually as you add them. I suppose you could create a tool that take a class you designed visually and writes records to a table from all the controls in it, then have another class (the "real" one that gets instantiated) spin through that table, creating objects of the proper class and setting the properties as per the info in the table.

I have never run into this problem personally because I don't have a VCX of client-specific base controls (I can't think of anything about a textbox that would be client-specific, for example).

>I want the textbox to be linked to the data, but at design time, I don't want to set the controlsource of the textbox.

This may also be resolved using the technique outlined above. Alternatively, you could have an array or collection at the container level that defines the control sources for the various controls. In the Refresh of each control (you can't do it in Init since that method fires for a control before the container), if ControlSource is empty, ask the container to return the control source for this control. The container would look in the array or collection and return the appropriate value.

Doug
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform