Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How do I programatically add objects to a PageFrame?
Message
 
À
27/07/2000 19:14:59
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00397937
Message ID:
00397948
Vues:
8
>Hi. I have a form that I want to create that will contain a listbox that will show a list of possible reports to run. When the user clicks on a report, I want to be able to 'paint' objects like radio buttons, textboxes, pick fields, etc. on a lower page frame, so if the user wants to run that report, they can enter the criteria according to the fields requested. (I'm doing this to avoid hundreds of report driving screens). It would be nice to have the 'AddObject' type item to call a program which would add the controls and refresh the pageframe, but I don't know if that is possible. Can this be done, and if so, which method(s) would I put the 'AddControls' code in?.
>
>I hope I'm explaining myself well enough, as I am a newbie in VFP 6.0 and most of my code experience was in FPW2.6.
>
>Thanks In Advance
>
>Sandi Cassidy
>scassidy@canaccount.com

Hi Sandi,

Each container class in VFP (i.e Form, Page, Container, etc.) has AddObject() (as well as RemoveObject() ) method.
A better way to do this could be not to add individual controls, but create a container which provides required functionality with all necessary controls and code in it and save it as a class. Use the Class Designer to do this. So, when you need, say the report options functionality you may add this container to your form and make it visible. Also the report options can be provided in another Form which you will run on selection of one of the reports. If you need different sets of controls to select your options, you may have more than one options container in your class library, and add the corresponding container to your report options form.
You should analyze your required report options so you can create the most generic class for that.
Nick Neklioudov
Universal Thread Consultant
3 times Microsoft MVP - Visual FoxPro

"I have not failed. I've just found 10,000 ways that don't work." - Thomas Edison
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform