Mike Yearwood
Toronto, Ontario, Canada
Information générale
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Network:
Windows 2008 Server
>I find it strange that when I set focus to a container object which has user controls on it, the focus goes to any of the controls on the container, but not the one that is set TabStop = 1.
>
>So when I call THISFORM.cntMyContainer.SetFocus(), it sets the focus to some control, like the third or fourth in the tab order on that container. When I TAB into the container, it does move first to the first control etc, so there is a difference between setting the focus with TAB or by calling SetFocus().
>
>It is quite annoying, because the behavior is nothing what the user would expect. I was wondering if somebody has a workaround for this, other than overwriting the SetFocus() of the container or create a custom method that does the focus thing, because that would be quite an overhead in the application.
Visual MaxFrame has code to iterate the containership hierarchy to locate the first control. It's overhead, but still very fast.
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement