This forum is temporaily read-only. All existing discussions remain available for reference. For new questions, bug reports or support requests, please contact us at mail@lmdsupport.com.

Caption font on TLMDFloatingForm

edited March 2014 in LMD-Tools
How can I control the font used for the caption of a TLMDFloatingFont?

When a panel is undocked and turned into a TLMDFloatingForm, it seems always to use the font defined in Vcl.Graphics.DefFontData, which is Tahoma. I think this is because the ParentFont property of a TCustomForm is False by default.

I tried to find an event fired when the form is undocked that I could handle to set the font, but so far without success.

Thank you.


Comments

  • edited March 2014
    I just found the answer.

    1. Subclass TLMDFloatingForm, and in the constructor set up the font.
    2. Set dockPanel.FloatingDockSiteClass to the class that overrides TLMDFloatingForm.

    So when TLMDDragObject.Init creates the floating form, it creates the subclass with the customised font instead of a plain TLMDFloatingForm.

    For some reason, setting ParentFont := True in the overridden constructor isn't quite enough. You also have to call Perform(CM_PARENTFONTCHANGED, 0, 0) explicitly, because the form doesn't have a parent when it is created.
  • Thanks for your feedback!
Sign In or Register to comment.