Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SetFocus() doing its own thing...
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
SetFocus() doing its own thing...
Divers
Thread ID:
00382456
Message ID:
00382456
Vues:
54
SetFocus is messing with me...

Let me set this up:

On a Form I have a PageFrame. On this PageFrame I have two Pages. On one Page I have, among other things, a listbox and multiple containers. Each container has 3 command buttons.

Each item in the listbox is associated with a single container. When that item is selected in the listbox, the appropriate container is displayed on the page, (all other containers are hidden).

Up until now, for each item in the listbox, after the user has selected the correct item, and the appropriate container has been displayed, tabbing off the listbox would result in another listbox on the page receiving focus.

Now I need to do the following: For one specific item in the listbox, when the user tabs from the listbox I need to setfocus to one of the command buttons on the displayed container. So in the KeyPress() method of the listbox I put the following code:
IF (correct item in listbox)
    Thisform.Page.Pageframe.AppropriateContainer.cmdEdit.SetFocus()
ENDIF
This results in the command button on that control with a taborder of one greater than the taborder of cmdEdit actually receiving the focus. So if cmdDelete.taborder=1, cmdEdit.taborder = 2, and cmdAdd.taborder = 3, and I wanted cmdEdit to receive focus, I would have to set the focus to cmdDelete.

Can anyone explain this?
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform