Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to remove a page from a PF at design time
Message
De
02/10/2008 11:29:14
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Vista
Network:
Windows 2008 Server
Database:
MS SQL Server
Divers
Thread ID:
01352266
Message ID:
01352282
Vues:
24
Can you remove the pages in the parentclass then? I was originally under the impression you needed to keep all of the pages on the pageframe in the parent class...



>Tracy,
>
>Your reply kind of confirms that this is not a trivial question. I thought that maybe I was missing something. (Maybe I am!)
>
>I would prefer to do this at design time. These are pages that we originally intended to use, but during the developmet cycle found we no longer need. Seems a shared to keep them around and have to write code to clean them up.
>
>Jim
>
>>I usually remove them at runtime doing something like this:
>>
>>x =1
>>WITH THIS.PageFrame1   && is it pageframe1 or pageframe on your form?
>>     DO WHILE i <= .PageCount
>>         IF .Objects(i).Caption = "Page" && Add a check for your condition
>>             .REMOVEOBJECT(.Objects(i).Name)
>>         ELSE
>>             i = i +1
>>         ENDIF
>>     ENDDO
>>ENDWITH
>>
>>However, there are times when I am usually more successful processing in reverse:
>>
>>WITH THIS.PageFrame1  && is it pageframe1 or pageframe on your form? 
>>    FOR i = .PageCount TO 1 STEP -1
>>        IF UPPER(.Pages(i).Caption)='PAGE' && Add a check for your condition
>>            .REMOVEOBJECT(.Pages(i).Name)
>>        ENDIF 
>>    ENDFOR
>>ENDWITH
>>
>>
>>>I have a form with a page frame and 11 pages on it. The page frame is based on my own class, and the MemberClass and MemberClassLibrary for the pages on the pageframe are set in the properties of my pageframe class.
>>>
>>>I recently ran into trouble attempting to remove 2 of the pages from that pageframe using the form designer.
>>>
>>>When I tried deleting the pages directly from the form I got a message saying I couldn't do that because they were members of a class.
>>>
>>>So, in the form designer I moved the 2 pages I didn't want to the end, and then edited the pageframe class to reduce the pagecount from 11 to 9.
>>>
>>>But, then I was not able to then open the form in the form designer. I got an Error loading file message saying for one of the objects on one of the pages in the pageframe: Error loading file - record number 130. pfProjSubjDetail {or one of its membres}. Parent: object class is invalid for this container.
>>>
>>>Note that pfProjSubjDetail is a another pageframe on one of the pages of the pageframe class that I had just edited. But, not one of the 2 pages that I was attempting to delete.
>>>
>>>I went back and edited my pageframe class again, and changed the pagecount from 9 to 11, but I got the same error.
>>>
>>>I was able to get myself out of this by restoring the library containing my pageframe class definition from a backup tape.
>>>
>>>So, how do I remove these pages?
>>>
>>>Thanks for your thoughts,
>>>Jim
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform