Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Sonstige Fragen zu Delphi (https://www.delphipraxis.net/19-sonstige-fragen-zu-delphi/)
-   -   Delphi MessageDlg (https://www.delphipraxis.net/32377-messagedlg.html)

aufgehts 22. Okt 2004 11:37


MessageDlg
 
Hallo,
wie kann ich die hintergrundfarbe der Delphi-Dialogbox "MessageDlg" ändern.

Danke für die antworten

Mario 22. Okt 2004 11:57

Re: MessageDlg
 
Da kommst Du nicht ran, weil intern auf die Windows-Standarddialog zurückgegriffen wird. Es wird einfacher, wenn Du einen eigenen Dialog knetest.

shmia 22. Okt 2004 12:33

Re: MessageDlg
 
oder du nimmst die Funktion
Delphi-Quellcode:
function CreateMessageDialog(const Msg: string; DlgType: TMsgDlgType;
  Buttons: TMsgDlgButtons): TForm;
und dann
Delphi-Quellcode:
function MessageDlgPosHelpWithColor(const Msg: string; DlgType: TMsgDlgType;
  Buttons: TMsgDlgButtons; HelpCtx: Longint; X, Y: Integer;
  const HelpFileName: string; Acolor:TColor): Integer;
begin
  with CreateMessageDialog(Msg, DlgType, Buttons) do
    try
      HelpContext := HelpCtx;
      HelpFile := HelpFileName;
      Color := AColor; // <==
      if X >= 0 then Left := X;
      if Y >= 0 then Top := Y;
      if (Y < 0) and (X < 0) then Position := poScreenCenter;
      Result := ShowModal;
    finally
      Free;
    end;
end;


Alle Zeitangaben in WEZ +1. Es ist jetzt 08:26 Uhr.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz