size : 472
uploaded_on : Thu Apr 29 00:00:00 1999
modified_on : Wed Dec 8 14:03:39 1999
title : Colored message dialog
org_filename : ColoredMsgDlg.txt
author : Ulli Conrad
authoremail : uconrad@gmx.net
description : How to display MessageDlg with colored text
keywords :
tested : D3
submitted_by : The CKB Crew
submitted_by_email : ckb@netalive.org
uploaded_by : nobody
modified_by : nobody
owner : nobody
lang : plain
file-type : text/plain
category : delphi-misc
__END_OF_HEADER__
>How can I put coloured text in the MessageDlg function?
procedure TForm1.Button1Click(Sender: TObject);
var
MsgForm : TForm;
i : integer;
begin
MsgForm := CreateMessageDialog('Colored message', mtInformation, [mbOK]);
with MsgForm do
begin
for i:=0 to ComponentCount-1 do // Find label
if Components[i] is TLabel then
(Components[i] as TLabel).Font.Color:=clNavy; // or any other color you like
ShowModal;
end;
MsgForm.Free;
end;