| Register | FAQ | Calendar | Search | Today's Posts | Mark Forums Read |
|
#1
| |||
| |||
| Is there a way to get the component which is using/invoking the popup menu? Example: Popup menu is assigned to many TStringGrid Components. On click of a menu item of a component I want to type cast the TStringGrid like TStringGrid(Owner).CopyToClipBoard. Delphi 6 joseph |
|
#2
| |||
| |||
| joseph wrote: > Is there a way to get the component which is using/invoking the popup menu? > > Example: > Popup menu is assigned to many TStringGrid Components. On click of a menu > item of a component I want to type cast the TStringGrid like > TStringGrid(Owner).CopyToClipBoard. > > Delphi 6 > > joseph > > There is a tag field in each component. Jim P |
|
#3
| |||
| |||
| My problem is that clicking on a menu item the owner of the component is the form and not the grid. joseph "Jim P" <Jim_P@mad.scientist.com> wrote in message news:4898031b@newsgroups.borland.com... > joseph wrote: > > Is there a way to get the component which is using/invoking the popup menu? > > > > Example: > > Popup menu is assigned to many TStringGrid Components. On click of a menu > > item of a component I want to type cast the TStringGrid like > > TStringGrid(Owner).CopyToClipBoard. > > > > Delphi 6 > > > > joseph > > > > > There is a tag field in each component. > > Jim P |
|
#4
| |||
| |||
| joseph wrote: > Is there a way to get the component which is using/invoking the popup > menu? > > Example: > Popup menu is assigned to many TStringGrid Components. On click of a > menu item of a component I want to type cast the TStringGrid like > TStringGrid(Owner).CopyToClipBoard. The TPopupMenu component has a PopupComponent property for exactly this purpose. -- Peter Below (TeamB) Don't be a vampire (http://slash7.com/pages/vampires), use the newsgroup archives : http://www.tamaracka.com/search.htm http://groups.google.com |
|
#5
| |||
| |||
| Thanks, that's what I needed. joseph "Peter Below (TeamB)" <none@nomail.please> wrote in message news:xn0ftkeyc1ejdm000@newsgroups.borland.com... > joseph wrote: > > > Is there a way to get the component which is using/invoking the popup > > menu? > > > > Example: > > Popup menu is assigned to many TStringGrid Components. On click of a > > menu item of a component I want to type cast the TStringGrid like > > TStringGrid(Owner).CopyToClipBoard. > > The TPopupMenu component has a PopupComponent property for exactly this > purpose. > > -- > Peter Below (TeamB) > Don't be a vampire (http://slash7.com/pages/vampires), > use the newsgroup archives : > http://www.tamaracka.com/search.htm > http://groups.google.com |
|
#6
| |||
| |||
| "joseph" <pelli@euroweb.net.mt> wrote in message news:489801ed$1@newsgroups.borland.com... > Is there a way to get the component which is using/invoking the popup > menu? TPopupMenu has a PopupComponent property for that exact purpose. > Popup menu is assigned to many TStringGrid Components. On click > of a menu item of a component I want to type cast the TStringGrid > like TStringGrid(Owner).CopyToClipBoard. procedure TForm1.CopyMenuItemClick(Sender: TObject); begin TStringGrid(TPopupMenu(TMenuItem(Sender).GetParent Menu).PopupComponent).CopyToClipboard; end; Or, if you already know which TPopupMenu ahead of time: procedure TForm1.CopyMenuItemClick(Sender: TObject); begin TStringGrid(PopupMenu1.PopupComponent).CopyToClipb oard; end; Gambit |
![]() |
| Thread Tools | |
| Display Modes | |
In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.