View Single Post
 
Old 08-31-2018, 03:29 AM
Glenn1234 Glenn1234 is offline
Senior Member
 
Join Date: Aug 2009
Posts: 130
Default

You can try doing it programmatically by iterating the components. Below is kind of a rough try at it. I'm sure there's more component types you could set, but the basic idea of what you'd need to do is below.



Code:
procedure AppForceFont(Application: TApplication; Name: String; Size: Integer);
// forces all forms in an application object to the same font name and size.
var
  i, j: integer;
begin
  for i := 0 to (Application.ComponentCount - 1) do
    begin
      if Application.Components[i] is TForm then
        With TForm(Application.Components[i]) do
          begin
            Font.Name := Name;
            Font.Size := Size;
            for j := 0 to (ComponentCount - 1) do
              begin
                if Components[j] is TLabel then
                  with TLabel(Components[j]) Do
                    begin
                      Font.Name := Name;
                      Font.Size := Size;
                    end;
                if Components[j] is TEdit then
                  with TEdit(Components[j]) Do
                    begin
                      Font.Name := Name;
                      Font.Size := Size;
                    end;
                if Components[j] is TMemo then
                  with TMemo(Components[j]) Do
                    begin
                      Font.Name := Name;
                      Font.Size := Size;
                    end;
              end;
          end;
    end;
end;
Reply With Quote