>Hi,
>
>I am wondering how others deal with the following situation. Here is how I do:
>
>I have a form where some customers need to see a row of controls (three labels and three textboxs). Other customer do not need to see or use them.
>I place these controls on the form and set the Visible of all to .T.
>At run time, when the form is initialized - based on some setting that calls for these controls not be be used - the code sets the property Visible of all controls to .F. Then, there is a LOOP through all controls and the TOP value is decreased by 26 (the space for these controls).
>This works. But I wonder how others would do it.
>
>TIA
I usually do the opposite:
The controls are added through a factory method that evaluates the license and instantiates objects on the fly or does other things. Most forms have a plug in method that gets called from the init which the factory can evaluate. If you have only one license that has exceptions, it may not be worth to introduce a complex system, but if you get a few of those it soon will be necessary to manage that well.
In some cases it is also better to have a subclass or a copy of the said form and instantiate the form depending on the license.
Christian Isberner
Software Consultant