Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 47861
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T16:11:21+00:00 2026-05-10T16:11:21+00:00

I’m trying to iterate all the controls on a form and enable ClearType font

  • 0

I’m trying to iterate all the controls on a form and enable ClearType font smoothing. Something like this:

procedure TForm4.UpdateControls(AParent: TWinControl); var   I: Integer;   ACtrl: TControl;   tagLOGFONT: TLogFont; begin   for I := 0 to AParent.ControlCount-1 do   begin     ACtrl:= AParent.Controls[I];      // if ParentFont=False, update the font here...      if ACtrl is TWinControl then       UpdateControls(Ctrl as TWinControl);   end; end; 

Now, is there a easy way to check if ACtrl have a Font property so i can pass the Font.Handle to somethink like:

GetObject(ACtrl.Font.Handle, SizeOf(TLogFont), @tagLOGFONT); tagLOGFONT.lfQuality := 5; ACtrl.Font.Handle := CreateFontIndirect(tagLOGFONT); 

Thank you in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T16:11:21+00:00Added an answer on May 10, 2026 at 4:11 pm

    You use TypInfo unit, more specifically methods IsPublishedProp and GetOrdProp.

    In your case, it would be something like:

    if IsPublishedProp(ACtrl, 'Font') then   ModifyFont(TFont(GetOrdProp(ACtrl, 'Font'))) 

    A fragment from one of my libraries that should put you on the right path:

    function ContainsNonemptyControl(controlParent: TWinControl;   const requiredControlNamePrefix: string;   const ignoreControls: string = ''): boolean; var   child   : TControl;   iControl: integer;   ignored : TStringList;   obj     : TObject; begin   Result := true;   if ignoreControls = '' then     ignored := nil   else begin     ignored := TStringList.Create;     ignored.Text := ignoreControls;   end;   try     for iControl := 0 to controlParent.ControlCount-1 do begin       child := controlParent.Controls[iControl];       if (requiredControlNamePrefix = '') or          SameText(requiredControlNamePrefix, Copy(child.Name, 1,            Length(requiredControlNamePrefix))) then       if (not assigned(ignored)) or (ignored.IndexOf(child.Name) < 0) then       if IsPublishedProp(child, 'Text') and (GetStrProp(child, 'Text') <> '') then         Exit       else if IsPublishedProp(child, 'Lines') then begin         obj := TObject(cardinal(GetOrdProp(child, 'Lines')));         if (obj is TStrings) and (Unwrap(TStrings(obj).Text, child) <> '') then           Exit;       end;     end; //for iControl   finally FreeAndNil(ignored); end;   Result := false; end; { ContainsNonemptyControl } 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
For some reason, after submitting a string like this Jack’s Spindle from a text
I am trying to render a haml file in a javascript response like so:
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have a text area in my form which accepts all possible characters from
I have some data like this: 1 2 3 4 5 9 2 6
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I would like to count the length of a string with PHP. The string

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.