Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Form is not active on the second call
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01249847
Message ID:
01250626
Vues:
19
>Hi Naomi,
>
>> The reason for this code is that I want the pageframe to start with 0 as an ActivePage. I forgot the exact reason for this right now.
>
>You can't set ActivePage to 0. VFP does so when you create a pageframe class with no pages which usually do in order to be able to rename the first page. Because 0 is invalid for ActivePage, the form designer automatically sets it to 1 in the loaded copy. Unless you change this value it's not stored back. When VFP loads the class outside the designer this automatic "correction" doesn't happen.
>
>> Good point, but I try to never call SetFocus from the Init.
>
>The problem is usually not code in the Init but in some generic method. For instance, when you change the underlying data of a grid you must move the focus to the grid to refresh it. If the code isn't checking for Thisform.Visible, your form might become visible because loading a record in the business layer triggered some controller which trigger the generic grid method.
>
>> Also why the problem is intermittent?
>
>It might be timing, it might be the position of the mouse, a timer, or many other things.
>
>> I think it may be related to the fact I have a timer and another window activated for tooltips in the grid
>
>That could be it. The other window might become active before the form is visible which would change the activation order. The window that was active at the time the tooltip is displayed might suddenly become the window that is active instead of the new form.

Hi Christof,

I removed the timer object from the form and added code adding it in first page Activate method and the problem seems to go away.

Appreciate your help a lot.
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform