Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Font size in MessageDlg

828 views
Skip to first unread message

Alan MacArthur

unread,
Oct 7, 1999, 3:00:00 AM10/7/99
to
Can it be changed? It's too small for me to see easily!

Luisa

unread,
Oct 8, 1999, 3:00:00 AM10/8/99
to
Hi Allan,

I found this example on the web - don't know yet if it's working .....

Luisa.

>The Dialogs unit contains the MessageDlg function which in turn calls a
function called >MessageDlgPos. MessageDlgPos calls CreateMessageDialog
which actually creates the message >dialog and returns it. If you alter
MessgeDlgPos (or create a new one) you can change the font of the >dialog.

>ex. of a new MessageDlgPos to set font name, size and style:

>function MessageDlgPosSetFont(const Msg: string; DlgType: TMsgDlgType;
> Buttons: TMsgDlgButtons; HelpCtx: Longint; X, Y: Integer;
sFontName:string;
> iFontSize: Integer; fsStyle: TFontStyles): Integer;
>begin
> with CreateMessageDialog(Msg, DlgType, Buttons) do
> try
> HelpContext := HelpCtx;
> if X >= 0 then Left := X;
> if Y >= 0 then Top := Y;
> // set the font name, size and style
> Font.Name:=sFontName;
> Font.Size:=iFontSize;
> Font.Style:=fsStyle;
> Result := ShowModal;
> finally
> Free;
> end;
>end;

Alan MacArthur skrev i meddelelsen <37FCE5...@boeing.com>...

Alan MacArthur

unread,
Oct 8, 1999, 3:00:00 AM10/8/99
to Luisa
Follow-up to "it works great" --- it still does! Also, if you eliminate
the X and Y definitions, the dialog box will be centered on the screen.

Alan MacArthur

unread,
Oct 8, 1999, 3:00:00 AM10/8/99
to Luisa
Thanks a lot! Cut and paste, and it works great!
0 new messages