DBNavigator的OnClick事件中判断if Button = nbInsert then。

解决方案 »

  1.   

    procedure Tfrmglenmt.navgtClick(Sender: TObject;
      Button: TOracleNavigateBtn);
    begin
      case Button of
        nbCancel : begin
                     edtENTITY.Enabled := true;
                     navgt.BtnClick(nbRefresh);
                     edtENTITY.SetFocus;
                   end;
        nbpost: begin
                  edtentity.enabled:=true;
                  edtentity.setfocus;
                  if isclick=true then
                  begin
                  str_entity:=trim(edtentity.Text);              if found_p  and (chkisautoloc.Checked=true) and (edtentity.Text<>entity_s) then
                    begin
                      showmessage('&sup2;&raquo;&Auml;&Uuml;&Oacute;&ETH;&para;à&cedil;&ouml;&Ouml;÷&raquo;á&frac14;&AElig;&micro;&yen;&Icirc;&raquo;&pound;&iexcl;');
                      odstUSER.Locate('entity',str_entity,[loCaseInsensitive]);
                      odstuser.Edit;
                      odstuser.FieldByName('primarys').AsString:='N';
                      odstuser.Post;
                     // navgt.DisableMoveBtn;
                    end;
                  isclick:=false;
                  found_p:=odstUSER.SearchRecord('primarys','Y',[srFromBeginning]);
                  entity_s:=odstuser.FieldValues['entity'];
                  odstUSER.Locate('entity',str_entity,[loCaseInsensitive]);
                  end;
                end;
      end;
    end;给你参考。。