Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Stop page change in a pageframe during a lostfocus??
Message
De
15/08/2000 15:56:00
 
 
À
15/08/2000 15:34:49
Peter Brama
West Pointe Enterprises
Detroit, Michigan, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00405163
Message ID:
00405173
Vues:
22
Try creating a method on your form called CheckPageChanged and a property called nPageNo and nLastPageNo. Then, in the activate of each page, put the following code:

Thisform.nPageNo = Thisform.Pagframe1.Activepage
IF THISFORM.nPageNo <> THISFORM.nLastPageNo
THISFORM.checkpagechanged()
THISFORM.PAGEFRAME1.ACTIVEPAGE = THISFORM.nPageNo
ENDIF

Then, in the CheckPageChanged method, put code that runs specific code needed for each page in your page frame in a Do Case...EndCase to determine if you want to allow the user to leave the previous page. If you need to stay on the current page, just set the nPageNo property to the page you want to stay on. Be sure to set the value of nLastPageNo to nPageNo in the checkpagechanged method if you are allowing the user to move off the page.

*here is an example of what I have in my CheckPageChanged method:
IF THISFORM.datachanged()
IF THISFORM.asktosave() = IDCANCEL
*!* user chose cancel - do not move to selected page
THISFORM.lcancel = .T.
THISFORM.nPageNo = THISFORM.nLastPageNo
ENDIF
ENDIF

* everything is o.k. - move on to selected page
thisformset.nRecordNo = 0
THISFORM.nLastPageNo = THISFORM.nPageNo
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform