Change the font in the CHOOSECOLOR dialog box

I use the general Windows CHOOSECOLOR control, but on Win 7 it sticks out like a sore thumb, since it still uses the 'old Tahoma font.

ChooseColor Dialog

Is there an easy way to get it to use Segoe UI or some other font?

If this is important, I am using Delphi / C ++ Builder ...

+7
source share
1 answer

I don’t think it’s a good idea to change the default font, but of course this is 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 font Form1.Font .

Color Dialog with custom font

However, in this case, I could just find this acceptable:

Color Dialog with default font (Tahoma)Color Dialog with Segoe UI font

Tahoma (default) and Segoe user interface

But! There is a problem:

Color Dialog with default font - no issues

Color Dialog with custom font causing issues

I think the safest thing is not to change the default dialog box appearance. Then at least you can blame Microsoft for any scaling issues ...

+9
source

All Articles