How to Support "System Font" in InputQuery Delphi Function

If you have applied my techniques fixing Large Fonts and System Font to all forms in your Delphi application, most likely there will be two forms still untouched. These will be the forms hidden inside MessageDlg and InputQuery VCL functions.

Fortunately, MessageDlg supports Large Fonts and System Font ok, but InputQuery supports only Large Fonts. In this post I will show how to modify InputQuery to support System Font.

Screenshot: Original InputQuery when System Font is Tahoma, DPI=120

InputQuery not supporting System Font

InputQuery implementation is hidden inside VCL, so a patch to VCL source code is needed.

  1. Locale Dialogs.pas unit in VCL source folder
  2. Save As Dialogs.pas to project folder using NewDialogs.pas file name
  3. Go to Project/Options/Directories/Conditionals/Aliases/Unit Aliases and define new unit alias: Dialogs=NewDialogs
  4. Locate InputQuery function in implementation part of NewDialogs.pas unit
  5. Insert code from previous post System Font right before "if ShowModal = mrOk then" line
  6. Build the project

The resulting InputQuery window will look like:

New InputQuery supporting System Font

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.