Club Delphi  
    FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > Varios
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

Grupo de Teaming del ClubDelphi

 
 
Herramientas Buscar en Tema Desplegado
  #5  
Antiguo 05-02-2008
RicardoNavarro RicardoNavarro is offline
Registrado
 
Registrado: ago 2006
Posts: 6
Poder: 0
RicardoNavarro Va por buen camino
Color MessageBox

Espero sirva

Código Delphi [-]
function MiMensaje(XTexto, XTitulo: String): Boolean;
var
  LForm: TForm;
  CaptionIndex, i: integer;
  LNombres: array of string;
  LFondo, LColor: TColor;
  LICono: TMsgDlgType;
  LBotones: TMsgDlgButtons;
begin
  LFondo := clGreen;
  LColor := clWhite;
  LIcono := mtInformation;
  LBotones := [mbOK];
  SetLength(LNombres, 1);
  LNombres[0] := '&Cerrar';
  if XTitulo = 'Cuidado' then
    begin
      LFondo := clYellow;
      LColor := clBlack;
      LIcono := mtConfirmation;
      LBotones := [mbYes,mbNo];
      SetLength(LNombres, 1);
      LNombres[0] := '&Si';
    end
  else if XTitulo = 'Peligro' then
    begin
      LFondo := clRed;
      LColor := clYellow;
      LIcono := mtWarning;
      LBotones := [mbYes,mbNo,mbAbort];
      SetLength(LNombres, 3);
      LNombres[0] := '&Si';
      LNombres[1] := '&No';
      LNombres[2] := '&Cerrar';
    end;
  LForm := CreateMessageDialog(XTexto, LIcono, LBotones);
  LForm.Caption := XTitulo;
  LForm.Color := LFondo;
  LForm.BorderIcons := [];
  CaptionIndex := 0;
  for i := 0 to LForm.ComponentCount - 1 do
    begin
      if (LForm.Components[i] is TLabel) then
        begin
          TLabel(LForm.Components[i]).Font.Style := [fsBold];
          TLabel(LForm.Components[i]).Font.Color := LColor;
          TLabel(LForm.Components[i]).Font.Size := 12;
        end;
      if (LForm.Components[i] is TButton) then
        begin
          if CaptionIndex > High(LNombres) then
            Break;
          TButton(LForm.Components[i]).Caption := LNombres[CaptionIndex];
          Inc(CaptionIndex);
        end;
    end;
  with LForm do
    begin
      try
        ShowModal;
      finally
        Free;
      end;
    end;
  if LForm.ModalResult = mrYes then
    Result := True
  else
    Result := False;
end;

Última edición por dec fecha: 05-02-2008 a las 16:18:08.
Responder Con Cita
 



Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro

Temas Similares
Tema Autor Foro Respuestas Último mensaje
Aplicacion Multi-idiomas - MessageBox Traducir en run-time le4br Varios 2 19-03-2005 21:35:31
cambiar el estilo del texto de MessageBox? Er_Manué Varios 1 16-12-2004 14:49:02
¿Y tú qué bebes? Nuria Debates 13 29-03-2004 12:39:27
Cambiar Foco en messagebox. BECERRA OOP 2 15-12-2003 09:15:34
Cambiar icono de exepor código Descendents Varios 2 09-12-2003 16:59:09


La franja horaria es GMT +2. Ahora son las 06:20:17.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi