Prateek Shukla
Prateek Shukla

Reputation: 595

Delphi 7 change the font size of message box content

I am using below code which satisfy my requirement to show message in Hindi(other than English) language for a desktop application, but the displayed message's font size is quite small. The code is as below-

line: UTF8String;

MessageBoxW(0,pwidechar(UTF8decode(line)),pwidechar(UTF8decode(line)),0);

From where it does pick the font size and what will I need to additionally add to change the font size? I followed the thread "How do I use a specific font in a message box?" but the problem is to use the utf8string (in Hindi) on that form to display.

Upvotes: 0

Views: 2430

Answers (1)

J...
J...

Reputation: 31393

The font and font size used for system dialog boxes is set globally in Windows by the user (this dialog is accessed in various different ways in different versions of Windows).

enter image description here

You cannot (or, rather, really really should not) change this setting programmatically since it does not just affect your application but all applications that run on the system for that user.

Displaying a custom dialog box is an option, per this question's answers but since you are using Delphi 7 the VCL does not natively support Unicode strings for any of its visual components. You would need to look into either using a set of third-party Unicode-aware VCL components (TNT Controls are still available free, unsupported, if you look) or, alternatively, design new ones yourself. The former option is naturally the most sensible.

Upvotes: 1

Related Questions