Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
DoubleClick on Grid
Message
De
10/06/2008 06:40:43
 
 
À
09/06/2008 20:44:53
Ransome So
Ransome's Workshop
Hong Kong, Hong Kong
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Divers
Thread ID:
01322710
Message ID:
01322774
Vues:
13
In VFP 6, I can doubleclick on a grid row to have further action. However, I fail to do that at VFP 9. Have I forgetton something to set?

In VFP 6, you needed a special textbox sub-class to put in each grid column that had code like this in its DblClick():
This.Parent.Parent.dblClick()
This still works in VFP 9, but in VFP 9, there are other ways to accomplish this. One way is to set the grid's AllowCellSelection property to .F. because then, when you double click on the grid, it is the grid's DblClick() that fires and not the contained control's. If you need to AllowCellSelection, then this code in the grid's Init() will allow the dblClick of the contained controls to fire the grid's DblClick():
FOR lnCol = 1 TO This.ColumnCount
  loColumn = This.Columns[ lnCol ]
  FOR EACH loControl IN loColumn.Controls
      IF PEMSTATUS( loControl, [dblClick], 5 )      
        BINDEVENT( loControl, 'dblClick', This, 'dblClick' )  
      ENDIF
      IF PEMSTATUS( loControl, [Click], 5 )      
        BINDEVENT( loControl, 'Click', This, 'Click' )  
      ENDIF
    ENDIF
  ENDFOR
ENDFOR
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform