Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
DFHGRID.VCX
Message
 
 
À
01/04/1998 23:32:47
Michael Haggerty
Blue Mountain Data Systems Inc
Herndon, Virginie, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Titre:
Divers
Thread ID:
00088869
Message ID:
00088986
Vues:
36
Michael,

Well I'd been meaning to integrate that code fragment for a while now, your message gave me the impetus to do it.

On the shape, remove the MouseDown() and put this in the MouseUp() instead:

LPARAMETERS nButton, nShift, nXCoord, nYCoord

* converts a mouse click in the shape to activate the underlying grid cell

local lnRow, lnCol, lnWidth, loGrid

lnWidth = 0
nXCoord = nXCoord - this.Left

loGrid = evaluate( "this.parent." + this.mcGridName )

lnRow = int( 1 + ( this.Top - ( loGrid.Top + loGrid.HeaderHeight ) ) / loGrid.RowHeight )

for lnCol = loGrid.LeftColumn to loGrid.ColumnCount
   lnWidth = lnWidth + loGrid.Columns[lnCol].Width + loGrid.GridLineWidth
   if ( lnWidth > nXCoord )
      exit
   endif
endfor

lnCol = lnCol - loGrid.LeftColumn + 1

loGrid.SetFocus()
loGrid.ActivateCell( lnRow, lnCol )

The only thing I don't like about this though is that if you keep the highlight visible while the grid has focus, or click back into the same grid row the click won't feed though and position the I-beam cursor at the position of the mouse
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