Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
MousePointer in read-only grid
Message
 
 
To
03/02/1999 09:23:06
Magnus Persson
Widmark & Platzer Ab
Stockholm, Sweden
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00183337
Message ID:
00183724
Views:
27
Magnus,

>Thanks, I think it will be possible to capture the click event of the shape-object, and force a click event at the same coordinates for the underlying grid. At least I will give it a try.

This code converts clicks in a transparent shape positioned of the cells part of the grid.
LPARAMETERS nButton, nShift, nXCoord, nYCoord

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

local lnRow, lnCol, lnWidth
lnX = objtoclient( this, 2 ) + thisform.Left - 2
lnY = objtoclient( this, 1 ) + thisform.Top - 2
lnRow = int( 1 + ( nYcoord - this.Top ) / thisform.grdTheGrid.RowHeight )

lnWidth = 0
nXCoord = nXCoord - this.Left

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

lnCol = lnCol - thisform.grdTheGrid.LeftColumn + 1

thisform.grdTheGrid.ActivateCell( lnRow, lnCol )
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform