Board index » delphi » HELP: DBNavigator

HELP: DBNavigator

I am trying to run a procedure whenever the insrt button is pushed on
DBNavigator. I see a BeforeAction event but how can I test to see if
the insert button has been pushed?
jrlee
Dallas Design Systems
ddsystem.com

 

Re:HELP: DBNavigator


Use the OnClick event of the DBNavigator and insert this code
if button = nbInsert then ShowMessage('Insert button pressed');
Bye:-)

John Lee a crit dans le message <3599f80b.10162...@192.168.0.1>...

Quote
>I am trying to run a procedure whenever the insrt button is pushed on
>DBNavigator. I see a BeforeAction event but how can I test to see if
>the insert button has been pushed?
>jrlee
>Dallas Design Systems
>ddsystem.com

Re:HELP: DBNavigator


Hi John,

The type of button that you click (a TNavigateBtn) gets passed to the  
OnClick-event of the DBNavigator. So just write an "if button = nbInsert  
then" statement in the OnClick-event. Be warned though that this event  
gets called AFTER the record is inserted into the table. So perhaps a  
better place to set your procedure would be in the BeforeInsert-event of  
the corresponding TTable component.

Regards,

Patrick

Regarding message <3599f80b.10162...@192.168.0.1>
from <jr...@ddsystem.com> on 01 Jul 98:

Quote
> I am trying to run a procedure whenever the insrt button is pushed on
> DBNavigator. I see a BeforeAction event but how can I test to see if
> the insert button has been pushed?

Re:HELP: DBNavigator


Quote
John Lee wrote:

> I am trying to run a procedure whenever the insrt button is pushed on
> DBNavigator. I see a BeforeAction event but how can I test to see if
> the insert button has been pushed?
> jrlee
> Dallas Design Systems
> ddsystem.com

Hi John,

If I read your request correctly, I think what you're after is something
like this:-

inside the NavigatorBeforeAction or NavigatorClick events 'begin/end':-

case Button of
  nbInsert:
  begin
// your code here
  end;

More information is available by looking at the 'Button' parameter of  
TDBNavigator in Help.

Regards,

Stuart

Other Threads