TAdvStringGrid error on dynamic creation...

Hello,

Version 9.1.4.7, Delphi 10.2.3.

This code has been working for a few years. Not sure when this began. Testing today exposed it.

Dynamically creating a TAdvStringGrid.
When I try to set anything having to do with the font, failure.

Here is the calling code:

procedure TGraphicExcelGrid.SetStringGridProperties;
begin
 if not Assigned(grid) then       //might be a reload from a cancel in the animation dialog
  Exit;

 grid.Color:=bgColor;
 grid.Font.Name:=fontName;
// grid.Font.Size:=textSize;
// grid.Font.Style:=textStyle;
// grid.Font.Color:=fgColor;
// grid.Font.Charset:=charSet;
end;

Here is where it fails, line after inherited.

procedure TAdvDateTimePicker.CreateWnd;
var
  oldKind: TAdvDateTimeKind;
begin
  inherited;
  FOldCheck := Checked;
  oldKind := FKind;
  FKind := dkDate;
  Kind := oldKind;

  if not ParentFont and (LabelCaption <> '') and not (csDesigning in ComponentState) then
  begin
    FLblUpdate := true;
    LabelFont.Height := Round(FLblFntHeight * CalculateDPIScale(Self));
    FLblUpdate := false;
  end;

  if Assigned(FLabel) then
    UpdateLabelPos;
end;

Here is the stack trace.

Ideas?

Thanks,

Mark

We discovered this actually is caused by a bug in the VCL TDateTimePicker in Delphi 10.2
This bug can be reproduced with

var
  p: TDateTimePicker;
begin
  p := TDateTimePicker.Create(Self);
  p.Name := 'picker';
  p.Font.Name := 'Segoe UI';
end;

We implemented a workaround for this Delphi bug and this workaround will be in the next update.

Thank you.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.