Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Page access anomaly on a pageframe.
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00118893
Message ID:
00118899
Vues:
14
>I have a pageframe on a form that has several pages on it. A couple of them have conditions which will display a message indicating to the user that they cannot access the page. I do not wish to use the Enable property as some of the conditions may not be known when the form is first entered. If access is not permitted, I activate page 1 of the pageframe and there is no other code to run. If I click on the tab, this works great and control is returned to page 1. If I use the arrow keys, activate the page message, control stays on that page (the one where access shouldn't be). In the debugger, the pageframe's active page is correctly displayed as 1, but focus is remaining on a prohibited page. Why does the click work and not the arrow key?
>
>Thanks,

Steve,

Because the click pouts focus on the page and the arrow keys put focus on a control on the page. The control is refusing to give up focus.

You should use the Enabled property for this. You can do set that property dynamically at runtime in what ever methods are capable of causing the page to be disallowed. You can handle the situation in the form's refresh method. Then just have every control do a THISFORM.Refresh() and the refresh code will set the enabled properties of all pages in the pageframe.

Using the enabled property has a major advantage, that is that the user knows they can't go to that page without clicking it and then being told, "Sorry, that page you see which if fully enabled is not available to you". Giving users feedback is the best way to avoid problems down the road.

What I'm getting at is that it is better to make the page unavailable so it doesn't ever get focus, then to try and undo the focus after it happens.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform