>>>>Hi all
>>>>How can I add rightclick menu (I have a grid and I want to add rightclick menu for each cell).
>>>
>>>if you want to have one rightclick menu for all cells, then place the transparent shape over grid and use rightclick event
>>>of Shape to define popup menu and for processing of user choice.
>>
>>That way you make grid readonly :o) No way to click on it.
>
>And disable the scroll event... my users are giving me hell for this...
OTOH, the shape doesn't really have to cover the scrollbar. You can make the shape slightly shorter:
shape.width=grid.width-iif(bittest(grid.ScrollBars,1),Sysmetric(5),0)-4
Likewise, you should use headerheight+4 (or whatever is the thickness of the horizontal borders of the grid), plus sysmetric(8) to calculate the height, also adjust shape.top and shape.left, so the shape would cover cells only. You may cheat, though: make the shape opaque while you fiddle with its size and position :).
I'd still rather go with bindevents() myself. Though I didn't use the textbox's rightclick (bound to grid.myrightclick) to display a menu - I displayed a small modal form with buttons instead, simply because it's easier for me.