Changing font in CHOOSECOLOR dialog
I don't think it is a good idea to alter the default font, but sure, it's doable:
function EnumChildProc(hWnd: HWND; lParam: LPARAM): LongBool; stdcall;begin SendMessage(hWnd, WM_SETFONT, lParam, Integer(true)); result := true;end;procedure TForm1.ColorDialogShow(Sender: TObject);var dlg: TColorDialog;begin if not (Sender is TColorDialog) then Exit; dlg := TColorDialog(Sender); SendMessage(dlg.Handle, WM_SETFONT, Self.Font.Handle, Integer(true)); EnumChildWindows(dlg.Handle, @EnumChildProc, Self.Font.Handle);end;procedure TForm1.Button1Click(Sender: TObject);begin with TColorDialog.Create(nil) do try OnShow := ColorDialogShow; Execute(Handle); finally Free; end;end;
This will use the Form1.Font
font.
Still, in this case, I might just find it acceptable:
Tahoma (Default) vs. Segoe UI
But! There are issues involved:
The safest thing to do, I think, is not to alter the default (intended) appearance of the dialog. Then, at least, you can blame Microsoft for any scaling issues...