Delphi - Mensajes en Castellano, Solución

 
Vista:

Mensajes en Castellano, Solución

Publicado por Elena (1 intervención) el 14/09/2004 21:36:42
function TfrmCertificados.MyMessageDialog(const Msg: string;
DlgType: TMsgDlgType; Buttons: TMsgDlgButtons;
Captions: array of string): Integer;
var
aMsgDlg: TForm;
i: Integer;
dlgButton: TButton;
CaptionIndex: Integer;
begin
aMsgDlg := CreateMessageDialog(Msg, DlgType, Buttons);
captionIndex := 0;
for i := 0 to aMsgDlg.ComponentCount - 1 do
begin
if (aMsgDlg.Components[i] is TButton) then
begin
dlgButton := TButton(aMsgDlg.Components[i]);
if CaptionIndex > High(Captions) then Break;
dlgButton.Caption := Captions[CaptionIndex];
Inc(CaptionIndex);
end;
end;
Result := aMsgDlg.ShowModal;
end;
Para usarla solo haces esto:
Var
Resp : Word; //te toma el botón que presionaste
begin
Resp := MyMessageDialog('Se imprimió correctamente la solicitud. ¿Desea emitir e imprimir el certificado?' +#13
+'De no emitirlo ahora no podrá hacerlo más adelante.',mtConfirmation, [mbYes,mbNo,mbCancel],
['Reimprimir','Emitir','Cerrar']);
Case Resp of
mrYes : ShowMessage('Presionó Reimprimir');
mrNo : ShowMessage('Presionó Emitir');
mrCancel : ShowMessage('Presionó Cerrar');
end; //case
end;
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder