Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Putting Shortcut Menu into Grid Cell
Message
 
To
18/07/2001 03:38:38
Jimi Lee
Pop Electronic Products Ltd.
Hong Kong, Hong Kong
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00531450
Message ID:
00531968
Views:
13
This message has been marked as a message which has helped to the initial question of the thread.
>Thx Nadya,
>
>I dunno, if I place a shape over the grid, do I need to add codes to it in order to choose the row I want to process? Do I need to even put shapes on each row such that when I click on different shape, i'm working on different row? Would this be even more complicated than adding code to the grid directly?
>
>I've tried to search on the advisor.com, but just got some articales that ask me to read the printed articales <g>, actually I have those books too, just can't find what Nick said in his reply, Nick, any help?
>
>Jimi
>

Hi Jimi

You don't need the separate shapes for each row. Click-transparent shape(container) will pass the click through itself and click will normally activate whatever grid cell is under the mouse. This is just a different way of doing things. This approach allows to add the necessary functionality to any grid without changing anything in the grid itself, whether it is created in code or placed at design time. Of course you will need to properly resize and reposition the click-transparent control, so it covers your grid.
There is a sample file
http://advisor.com/wFiles.nsf/wCatID/MMf0012.nekln01.zip/$file/Nekln01.zip which contains all forms/classes. There is the exact sample where the righ-click menu is called that way. Look at FORMGRID1.SCX. The grid there is covered with cntGridCover click-transparent container class which is subclassed from cntTransparent class. Look at the code in the classes and in the instance in the form.

I don't know why you really adding the grid in code and not at design time. I never had to do this. May be you could just create it at design time, place the code in the column textbox and make the grid invisible until you need it.
Nick Neklioudov
Universal Thread Consultant
3 times Microsoft MVP - Visual FoxPro

"I have not failed. I've just found 10,000 ways that don't work." - Thomas Edison
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform