Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Accessing a pageframe from a menu
Message
General information
Forum:
Visual FoxPro
Category:
Menus & Menu designer
Miscellaneous
Thread ID:
00560122
Message ID:
00560337
Views:
19
>HELLO,
>QUESTION IS: I HAVE A SCREEN WITH 8 PAGES, CUSTOMER WOULD LIKE TO ACCESS PAGE 5 THROUGH A MENU
> ...QUESTION IS, NO PROBLEM ADDING THE WHOLE SCREEN, BUT HOW DO SPECIFY JUST PAGE 5???


It depends on whether or not the form is already running at the time. In other words: Should the form be instantiated and immediately be sent to page 5, or is the form already up and you just want to switch to page 5?

Let's assume the form is already there. In that case, you can access the form through the _Screen.ActiveForm reference in the following fashion:
_Screen.ActiveForm.WhateverNameThePageFrameHas.ActivePage = 5
If the form is not yet running, you need to launch it using a DO FORM command. While you are at it, you can pass a paremeter to the form to tell it what page to display:
DO FORM YourForm.scx WITH 5
In the init() of the form, you will need the following code to handle the parameter:
LPARAMETERS lnPage
IF VarType(lnPage) = "N"
   THIS.WhateverNameThePageFrameHas.ActivePage = lnPage
ENDIF
Makes sense?

Markus




Markus Egger
President, EPS Software Corp
Author, Advanced Object Oriented Programming with VFP6
Publisher, CoDe Magazine
Microsoft MVP since 1995
Previous
Reply
Map
View

Click here to load this message in the networking platform