Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Whats best way to programatically create a form.
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00666656
Message ID:
00666663
Vues:
16
Rodd,

I think the easiest way would basically be:

- Create a form class with the Class Designer, so you have your basic code and properties in there.
- At runtime do frmMyForm = CREATEOBJECT("MyFormClass")
- Then add controls with frmMyForm.AddObject("MyControlName", "Textbox")
- You can manipulate the controls with frmMyForm.MyControlName.Left = 10 and so on
- Make each added control visible with frmMyForm.MyControlName.Visible = .T.
- After everything is set up, make the form visible: frmMyForm.Show()

HTH,
Armin

>I'm wanting to create an automated program that generates forms based on information stored in tables. My dilema is this, in my code, I could issue the create form command and programatically add elements to the form, but this opens a form designer window which I don't know how to programatically close down. I don't want a user to have to sit there and close the form designer after each form is created.
>
>I could issue a "copy structure" command and then insert records into the .scx table. However, when you create a form, there are 4 records that are automatically added and I'm not sure of the meaning in some of the fields. For instance there is a record who's uniqueid is screen and one who's uniqueid is RESERVED. In the last record (the one with the uniqueid of reserved), the only data it has is in the field named Properties. This field contains (Arial, 0, 9, 5, 15, 12, 32, 3, 0). I don't know what those elements stand for or when or why I would put them there if I created this record.
>
>Also, if I were to create the form building it record by record, is the time stamp the elapsed seconds? Is there anything special in regards to the uniqueId field?
>
>Thanks for whatever help you can offer.
>
>Rodd

Armin Neudert
Regional Director (Stuttgart) of German FoxPro User Group dFPUG

MCP for Visual FoxPro

Expert/Editor of the VFP section in the German Codezone community portal
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform