Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Lock down a page in a pageframe
Message
De
20/04/2004 18:38:43
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00896682
Message ID:
00896691
Vues:
22
>I have a pageframe on a form and I don't want the user to exit that page if they pressed the [EDIT] button I have on that page, but have not pressed the [CANCEL] or [SAVE] button. Is there a way to keep the page from changing if a condition exits?
>
>Colombo.

You can add a property on your form that you can check for the ability to change pages or not in your Page.Deactivate code.

Say you have a form property named "StopMe" that's initialized to .F., and you have a button on page one that toggles this value between .T. and .F.. In your Page Deactivate, you can have code like this:
IF thisform.StopMe
  NODEFAULT
ENDIF
Here's an example form:
oX = CREATEOBJECT("stopme")
oX.Show(1)

DEFINE CLASS stopme as Form
StopMe = .f.
ADD OBJECT pgf1 as mypageframe WITH Visible=.T.
ENDDEFINE

DEFINE CLASS mypageframe as PageFrame
ADD OBJECT Page1 AS mypage
ADD OBJECT Page2 AS page

ENDDEFINE

DEFINE CLASS mypage as Page
ADD OBJECT cmd1 AS mycommandbutton WITH ;
  Height = 25, ;
  Width = 100, ;
  Left = 100, ;
  Top = 100, ;
  Caption = "Page 2 Allowed"

FUNCTION Deactivate
IF thisform.StopMe
  NODEFAULT
ENDIF
ENDFUNC
ENDDEFINE

DEFINE CLASS mycommandbutton as CommandButton
FUNCTION Click
thisform.StopMe = NOT thisform.StopMe
this.Caption = IIF(thisform.StopMe, "Stop Page2","Page2 Allowed")
ENDFUNC
ENDDEFINE
Fred
Microsoft Visual FoxPro MVP

foxcentral.net
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform