Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
CommandGroup: Finding which button was RightClicked
Message
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Miscellaneous
Thread ID:
00011007
Message ID:
00011064
Views:
34
>>Hopefully I am in the same ballbark. How about having the individual Button RightClicks call the Container RightClick method. Just pass the individual button name as a parameter.
>
>It's a little tricky because the number of buttons in the command group, plus their captions, are dynmically assigned at run time (and change repeatedly based on the context of the data being entered by the user).
>That is why it's so handy to simply know the ordinal number of the button that was clicked. The number serves as an index into several arrays that contain all kinds of directives that tell my app what to do next...basically a forward-chaining technique that is table driven.
>
>Anyway, the Click() event for the commandgroup works fine and lets the above happen. Capturing the RightClick() event the same way would enable some other interesting capabilities.
>
>Is it possible to subclass buttons used in commandgroup containers, or are you stuck with the base class version of the button? I was thinking that I could subclass the button itself so that it's rightclick would do whatever is necessary. The rightclick event would by necessity be the same for all buttons. That's OK, but the code needs to know which button (ordinal number) was clicked.

There is no problem indentifying buttons. For a numeric number you can create the button ID in a loop.Or just use the Name property of each button as your reference.

Tom
Tom
--------------------------------
Tom O'Hare
407-299-4268 -- tom@redtile.com -- http://www.redtile.com/
Independent Programmer Using Visual FoxPro, Visual Basic & more...
Operations Manager -- Virtual FoxPro User Group (VFUG)
http://www.vfug.org/ -- tom@vfug.org
President -- Central Florida FoxPro User Group (CFFUG)
http://www.redtile.com/foxpro/
Universal Thread Most Valued Professional (MVP)
http://www.transformation.com/foxpro/
Previous
Reply
Map
View

Click here to load this message in the networking platform