procedure ShowErrorMsg(Amsg:string);
begin
Application.MessageBox(PChar(Amsg), 'error', MB_OK);
abort;
end;
procedure TFrm_Main.Btn_1Click(Sender: TObject);
var
ss:array of string;
begin
SetLength(ss,3);
if InputQuery('密码修改',[Chr(0)+'旧 密 码',Chr(0)+'新 密 码',Chr(0)+'确认密码'],ss,
function (const Values: array of string): Boolean
begin
Result := False;
if Values[0]<>'123' then ShowErrorMsg('旧密码不正确');
if Values[1]<>Values[2] then ShowErrorMsg('两次密码不同');
Result := True;
end)
then begin
ShowMessage('请牢记您的新密码:'+SS[1]);
end;
end;