Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to get focus off grid during form deactivate?
Message
 
 
À
21/11/2008 17:01:45
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
01363424
Message ID:
01363596
Vues:
12
Mark,

Grids are particularly nasty about repulling focus. You may be able reset focus to a more benign control like a cmd on the original form before you launch the child form. Glad you got it working.

>Thanks for your reply David. I'm able to remove focus from the control ok, it was just that I needed to continue the focus to go to the new form afterwards.
>
>Anyway, I solved it by putting the code below in the form.Deactivate(). The issue was that VFP sometimes wants to repaint non-sparse grid columns even while focus is on another form. What I mean by repaint, is that my non-sparse column has a container with a textbox and other controls within. I use the textbox.value_assign() method to build items in the container on the fly (timeline bars in this case). Sometimes VFP wants to execute those textbox.value_assign()'s even when focus is on another form. I found that if focus is not on the grid when the form is deactivated and loses focus, VFP behaves itself and doesn't do this. So my code below puts the focus somewhere else on the form before it deactivates.
>
>In case anyone's interested, this is a really neat trick (using the value_assign() of a textbox in a container in a non-sparse column) to build the container for each row of the grid based on that row's table record. Maybe someone's done this before, but I've never seen it mentioned. It would have made a good FoxAdvisor Tip in the good ole days.
>Thanks again, Dave! -Mark
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform