Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Finding the right control
Message
 
 
À
13/07/1998 12:00:01
Bruce Gilmour
Cal-Mour Consultants
Calgary, Alberta, Canada
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00116218
Message ID:
00116851
Vues:
25
Bruce,

(again without the html typo)

I guess I missed the earlier part of the thread. This works for me:
<b>Form.KeyPress:</b>
#DEFINE KEY_PRESS_MENU_ACTIVATION .t.
LPARAMETERS nKeyCode, nShiftAltCtrl
debugout program()

if ( nKeyCode = 93 )
   * provide Shift+F10 shortcut menu activation
   this.RightClick( KEY_PRESS_MENU_ACTIVATION )
   nodefault
endif

<b>Form.RightClick:</b>
lparameter plKeyBooard
debugout program()

if ( plKeyBoard )
   this.ActiveControl.RightClick()
else
   this.ActiveControl.RightClick()
endif

<b>Grid.RightClick:</b>
debugout program()

this.SetFocus()
this.Columns[this.ActiveColumn].CurrentControl.RightClick()
Each of the textboxes in your grid needs to be derived from a textbox class with code to trap nKeyCode=93 and pass it on to the RightClick() like the form KeyPress above. Then you just have to code the specifics in the RightClick. You may not need the KEY_PRESS_MENU_ACTIVATION but that would let you detect a distinct RightClick on the form if it had it's own menu to popup.

>Thanks David. I tried your suggestion and it gets me away from the OKL but it has the same problem the OKL did. The 'this' refers to the form not the control and when I put in the _screen.activecontrol I was using before, I still can't get to the rightclick in the current control in a grid.
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