Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Form disappearing under another form
Message
De
26/10/1998 20:17:17
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Titre:
Form disappearing under another form
Divers
Thread ID:
00150735
Message ID:
00150735
Vues:
56
I have spent a few days trying to debug a problem, with no success.
VFP 5.0

I have a form (form1) (modeless) that is called from a menu. I want Form1 to call the click event for one of its buttons (btnpick). This should open another form (a pick list, lets call it form2, modal). In this list, I choose the button New which opens another form (form3) and I can add a new record to this other table.

My problem:

If I run form1 and physically click on btnPick, it brings up form2, I click on New from Form2 and get form3 and I can add a new record. All is fine.

BUT

If I run form1 with the call to the click event on btnpick from form1.init, form2 comes up fine, I choose New and form3 comes up but then control immediately goes back to form1 (i.e. form3 gets covered up by form1).

I have traced thru and found that when manually clicking on btnPick in form1, after form2 is unloaded (form3 comes up), control is back on read events and control is in form3 as it should be.

If btnpick is automatically clicked in the init of form1, after form2 is unloaded, form3 comes up but control is sent back to form1's activate method.

I believe this is because form1 activate hasn't been called yet. If I move the call to btnpick.click from init to a valid on the first field on form1, it works great but this means the user will have to go to the first field and leave it.

I need form1 to be sitting at read events and then automatically call btnpick.click without user intervention (i.e the user doesn't touch anything in form1 and the other forms will be called and work right).

Case of the misplaced code??

HELP PLEASE!

thanks,

Sally
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform