Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
One form calling another
Message
 
À
05/02/2001 16:57:47
Jerry Tovar
Dana Corporation Dana It
Maumee, Ohio, États-Unis
Information générale
Forum:
Visual Basic
Catégorie:
Applications Internet
Divers
Thread ID:
00472692
Message ID:
00472795
Vues:
30
>Using VB6, I have a search form that displays records in a grid. In the KeyPress() and DblClick() of the grid I issue:
>
> '''
> ln_code = mygrid.Columns.Item(0)
> form2.custno = ln_code
> form2.Show
> '''
>
>If I double click on the grid, the 2nd form displays correctly and has focus.
>
>If I press enter on the grid and my grid's keyPress() is called, the 2nd form displays but focus is returned to the 1st form.
>
>Why does the same code work differently from the DblClick() and Keypress events?
>
>How can I ensure that the 2nd form gets focus and stays on top?
>
>Thanks,
>
>Jerryt

because in the keypress event, the event is triggered before the key is released, launch your other form and come back to continue executing on form1.

Try adding a "keyascii = 0" at the start of the keypress event or use the keyup event.
Éric Moreau, MCPD, Visual Developer - Visual Basic MVP
Conseiller Principal / Senior Consultant
Moer inc.
http://www.emoreau.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform