私はDelphi7コードを使用して、ユーザーがタブを切り替える前に、タブに入力されたコメントが保存されていることを確認しています。
タブはにありTPageControl、このコードがトリガーされますOnExit
procedure TfCallerInfo.tsChaplainExit(Sender: TObject);
begin
{ Compare the saved DB value with the text in the comments field }
if (dmMain.qChaplainCOMMENTS.AsString <> dbmChapComments.Text) then
begin
ShowMessage ('Please save the comments before proceeding.');
pcDetail.ActivePage := tsChaplain; // Remain on the Current Page
tsChaplain.SetFocus;
end;
end;
tsInfoRequestたとえば、ユーザーが別のタブをクリックすると、検証はトリガーされますが、アクティブページtsInfoRequestは残りの代わりになりtsChaplainます。
私が間違っていることについて何か考えはありますか?