 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Francois Guest
|
Posted: Thu Jun 24, 2004 2:54 pm Post subject: Using TMenuItem |
|
|
Hi there
I have a pop-up menu that is linked to various TDBGrids, with
one TMenuItem for saving the grid to a text file.
My problem is that for the life of me I cannot figure out how to
access the actual grid that called the function since in the
event handler the "Sender" is the TMenuItem itself.
How do I get the grid from which the call originated???
/**
* This function gets called whenever the user clicks on
* the "Save to Text" menu item for grids.
*/
void __fastcall TNetAnSaveGridToFileDialogForm::SavetoTextMenuItemClick(
TObject *Sender) {
//here sender is the "TMenuItem" and not the "TDBGrid" from
//which the call orignated...
}
Any help appreciated!!!
Regards,
Francois
|
|
| Back to top |
|
 |
Antonio Felix Guest
|
Posted: Thu Jun 24, 2004 5:06 pm Post subject: Re: Using TMenuItem |
|
|
"Francois" <francois.lombard (AT) siemens (DOT) co.za> wrote:
| Quote: |
Hi there
I have a pop-up menu that is linked to various TDBGrids, with
one TMenuItem for saving the grid to a text file.
My problem is that for the life of me I cannot figure out how to
access the actual grid that called the function since in the
event handler the "Sender" is the TMenuItem itself.
How do I get the grid from which the call originated???
/**
* This function gets called whenever the user clicks on
* the "Save to Text" menu item for grids.
*/
void __fastcall TNetAnSaveGridToFileDialogForm::SavetoTextMenuItemClick(
TObject *Sender) {
//here sender is the "TMenuItem" and not the "TDBGrid" from
//which the call orignated...
}
Any help appreciated!!!
Regards,
Francois
|
Hi,
Dinamically assign the TMenuItem->Tag property with a value
related to the calling grid. Then in the Click Handler check
the Sender Tag in order to know the caller grid.
HTH
Antonio
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|