Jump to content
chkaufmann

Label Style and Color in DFM

Recommended Posts

Hi,

when I change the color and/or style (italic, underline) of the Font of any control (most of the time it's TLabel), then I get this in the DFM:

 

          Font.Charset = DEFAULT_CHARSET
          Font.Color = clHighlight
          Font.Height = -12
          Font.Name = 'Segoe UI'
          Font.Style = [fsBold]
          ParentFont = False
 

But the added information is only this:

 

          Font.Color = clHighlight
          Font.Style = [fsBold]
 

Now the only solution I see, is to write my own descendant for the control and add my own properties for Style and Color. But even then I would have to suppress usage of these properties during design time in order to leave Font/ParentFont unchanged. Or did I miss something?

 

Christian

 

Share this post


Link to post

The goal is, to avoid values for unchanged properties (Name, CharSet, Height) spread over all my controls in the DFM files. If I want my application using the Screen.MessageFont, automatic update does not work for all controls with different color and/or style.

 

Christian

Share this post


Link to post

That's how TFont is streamed, at least in VCL: Either you leave ParentFont at True or the complete TFont properties are stored. I hate that too.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×