The TToolbutton won't receive the focus, so you can use the ActiveControl 
property to know this. If you wanted to fire the OnClick code for the currently 
active dbgrid by clicking a toolbutton, you could code:

procedure TForm.AddTBClick(Sender: TOject);
begin
(ActiveControl as TDBGrid).MyDBGridClick;
end;

Dave

anomander1 <[EMAIL PROTECTED]> wrote:                               Hello,
 
 Maybe this has been on this forum before, but i could not find it.
 Sorry in advance if this has already been here.
 
 My problem is this.
 I have a TForm with 3 TDbGrids on them.
 There is 1 TToolbar with several toobuttons on them.
 What i would like is when i press the Add button on the TToolbar that
 the code corresponding to the TDbGrid fires.
 
 I know there is a way to use strings for this, but is there some other
 way to do this. I would like to know which component i was in BEFORE i
 pressed the button.
 
 TIA
 Marco
 
 
     
                               

       
---------------------------------
Be a better friend, newshound, and know-it-all with Yahoo! Mobile.  Try it now.

[Non-text portions of this message have been removed]

Reply via email to