Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Whats best way to programatically create a form.
Message
From
10/06/2002 15:19:14
Irv Adams
MSC Managed Care, Inc.
Florida, United States
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00666656
Message ID:
00666665
Views:
17
Rodd:

You could create a Form Class in code (or in design mode for that matter) and pass the items as Parameters to the Init event...
Define Class SpecialForm AS FORM
 Proc Init
 Parameters nHeight,nWidth,nShowStatus,cCaption, etc....
 WITH THIS
  .Height = nHeight
  .Width = nWidth
  ...
  ...
 EndProc
EndDefine
Later in your code you issue command like:
oNewForm = CreateObject("SpecialForm",300,200,0,"Test Form",...)
...and so forth, all at run-time.

HTH,

-Irv.

>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform