Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Missing Feature In VFP 7.0?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00697186
Message ID:
00697829
Vues:
19
I have several template SCX files for the different types of forms I use. My current form builders copy and rename a template file then use the following commands to open the new form file in design mode, create a reference to it and then add objects and set properties:
MODI FILE (newfile) NOWAIT

FOR ln = 1 TO _SCREEN.FormCount
   IF _SCREEN.Forms(ln).Name = "frmTemplate"
      lo = _SCREEN.Forms(ln)
      EXIT
   ENDIF
ENDFOR

lo.Caption = "My New Caption"
...
If I am using the code:
CREATE FORM (myform) AS myForm FROM myForms NOWAIT
don't I first have to convert my template SCX files into a VCX class file?

Is there some way I can use the Class Designer to accomplish this or does this just also work within the Class Designer tool?



>Why convert? This method works with the Class Designer as well.
>
>>Yes, this will work if I convert my template SCX files into form classes and use the "AS classname FROM classfile" parameters.
>>
>>I still would like to know why the other functionality was dropped in 7.0. With it I could create a series of builder programs that would operate on any form I had open in design mode or (even multiple forms).
>>
>>Programatic access to the design tools is a great feature! Thank you for suggesting this alternate method.
>>
>>
>>>Here's code that might work better for you:
>>>
>>>
CREATE FORM (myform) NOWAIT
>>>nObjs=ASELOBJ(aObjs,1)
>>>nIdx=0
>>>FOR i = 1 TO nObjs
>>>   IF UPPER(aObjs(i).Class) = "FORM"
>>>      nIdx=i
>>>   ENDIF
>>>ENDFOR
>>>aObjs(nIdx).Caption="I can change the form's caption in developer mode!"
>>>
>>>
>>>Note use of the ASELOBJ function.....
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>>In VFP 6.0 SP5 (or SP3?) the following code worked:
>>>>
>>>>MODI FORM (myform) NOWAIT
>>>>
>>>>FOR ln = 1 TO _screen.FormCount
>>>> IF _screen.Forms(ln).Name = "form1"
>>>> lo = _screen.Forms(ln)
>>>> EXIT
>>>> ENDIF
>>>>ENDFOR
>>>>lo.Caption = "I can change the form's caption in developer mode!"
>>>>
>>>>I could run this code from within an APP, EXE or PRG and use it to modify the form in design mode. But in VFP 7.0 the form being modified is not shown in the _screen.Forms collection.
>>>>
>>>>Was this an undocumented feature that was taken out of VFP 7.0? Will it be in VFP 8.0? I was able to create several form builders using this technique and they have saved me hours.
>>>>
>>>>What happened to one of my favorite features of VFP?
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform