Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Commanding pages
Message
From
17/07/1998 10:03:52
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00117842
Message ID:
00118572
Views:
20
>>In another post, I asked about adding pages programatically. Now I have a related problem. I want these pages to have code in their activate methods.
>>
>>How can I programatically add code to a newly created page?
>>
>>Thanks,
>>
>>-Michelle
>
>Michelle,
>
>The short answer is that you can't. You can, however, create a page class in a prg file and use that to add pages to your pageframe.
>
>
>* MyPages.prg
>DEFINE CLASS MyPage AS Page
>  PROCEDURE Activate
>     * Put your code here
>
>  ENDPROC
>ENDDEFINE
>
>
>Then when you want to add pages to a pagefraem at runtime you can;
>
>
>IF NOT "MyPages.prg" $ SET("PROCEDURE")
>   SET PROCEDURE TO MyPages.prg ADDITIVE
>ENDIF
>THISFORM.PageFrame1.AddObject("PageName","MyPage")
>
And the code for your MyPage.Activate method may simply be
Do Whatever with This

Somewhere in your form or a procedure file you can have a Procedure Whatever which will handle the cases. It can access all the properties of the page which got activated, and do practically anything.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Reply
Map
View

Click here to load this message in the networking platform