【发布时间】:2013-03-01 04:51:33
【问题描述】:
我正在使用 Delphi 7 代码,以确保在用户切换选项卡之前已保存在选项卡上输入的 cmets。
标签位于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。
知道我做错了什么吗?
【问题讨论】:
标签: delphi validation tabs delphi-7