I'm setting the main menu font (via Screen.MenuFont) to match the name/size of the font used everywhere else in the program. But the main menu doesn't refresh with the rest of the form - I have to pass the mouse over each menu item to have it repaint the item in the new font. How can I force the main menu to repaint on the change?
1 Answer
This is really easy:
Just call the DrawMenuBar
function and pass the handle to the form containing the menu:
procedure TForm1.FormClick(Sender: TObject);
begin
Screen.MenuFont.Name := 'Arial Black';
DrawMenuBar(Handle);
end;
-
2Maybe you could move call to
DrawMenuBar
toprocedure CMSysFontChanged(var Message: TMessage); message CM_SYSFONTCHANGED;
ofTForm1
. May 7, 2021 at 11:44 -