Skip to content

DFM streaming error with TBitBtn interposer (ParentFont property missing) #99

@surfjf69

Description

@surfjf69

Hello,

I encountered a compatibility issue when using the Vcl.StyledComponentsHooks interposer with TBitBtn.

Steps to reproduce

Create a form with a standard TBitBtn

Set ParentFont = False

Add Vcl.StyledComponentsHooks to the form's uses

Reopen or run the form

Result

The form fails to load with the error:

Error reading BitBtn1.ParentFont: Property ParentFont does not exist

Cause

The interposer defines:

TBitBtn = class(TStyledBitBtn) end;

Existing DFMs created with the standard Vcl.Buttons.TBitBtn often contain:

ParentFont = False

During DFM streaming Delphi tries to read this property, but it seems TStyledBitBtn does not publish ParentFont in the same way.

Workaround

Setting:

ParentFont = True

removes the error.

Environment

Delphi 12 Athens

VCL application

StyledComponentsHooks interposer

Suggestion

Maybe TStyledBitBtn should publish ParentFont (for compatibility with existing DFMs), or this limitation could be mentioned in the documentation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions