Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
DblClick on a Grid
Message
De
06/07/2000 00:43:10
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00387985
Message ID:
00388699
Vues:
7
>How do I activate a DblClick on a grid. I can put it in the controls and it will work but I want to be able to act on a double-click from the grid.

If you don't want to add it to each control, what you can do is this: create a grid class with the method ControlDblClick() in it (excepting one object reference). Everytime a column is added or in the Init() of the grid, you can remove the controls in the columns and add this class (as an example):
define class MyGridTextBox as textbox
    name = 'MyGridTextBox'
    procedure dblclick
          this.parent.parent.ControlDblClick(this)
    endproc
enddefine
Now you should be able to put code in the ControlDblClick() method of the grid instance on your form. THis method is also handy for adding things like easier to use events in header and column objects too, plus you can have conditional code based on what column its from thanks to the passed object reference.

>It's also awkward that I need to identify which row was double-clicked on.

Just look at the RecNo() of the RecordSource if you want that, or the ActiveRow property.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform