TAdvGlowButton bug

When using a TAdvGlowButton inside a TFrame which is then placed onto a form (put a TFrame with a TAdvGlowButton onto a TForm), there's a serious bug at run and designtime. Inside TAdvCustomGlowButton.Paint the Delphi function GetParentForm(self) is called which returns NIL, since the underlying frame is not a TCusfromForm causing a heavy exception.
Adding a workaround for GetParentForm() in the implkementation section of AdcGlowButton.pas fixes the issue:
function GetRealParentForm(Control: TControl; TopForm: Boolean = True): TCustomForm;
begin
while (TopForm or not (Control is TCustomForm)) and (Control.Parent <> nil) do
Control := Control.Parent;
if Control is TCustomForm then
Result := TCustomForm(Control)
else begin
// this part is new and works
if Control.owner is TControl
then Result := GetRealParentForm(TControl(Control.owner))
else Result:= NIL;
end;
end;

{$IFDEF CLR}[UIPermission(SecurityAction.LinkDemand, Window=UIPermissionWindow.AllWindows)]{$ENDIF}
function GetParentForm(Control: TControl; TopForm: Boolean = True): TCustomForm;
begin
// Override the "TopForm" parameter if the control passed in is in design mode
// This makes controls calling this function operate correctly when the designer
// is embedded
if csDesigning in Control.ComponentState then
TopForm := False;
Result := GetRealParentForm(Control, TopForm);
end;

Hello,
Could you tell us what version of the TMS VCL UI Pack and Delphi you are using and if you made any changes to the TAdvGlowButton's properties?

I've just tried this as you say. Start new application, add a new Frame, place a TAdvGlowButton on the Frame and adding the Frame in the Form. But I have no errors.

I'm using Delphi 10.3 and 10.4 and the latest TMS VCL UI Pack 10.3.5.1. When running my application, the form will be loaded. During this operation inside TAdvCustomGlowButton.Paint
sz := DrawVistaButton(Self, Canvas, drrect, GradColor, GradColorTo, GradColorMirror,GradColorMirrorTo,
PenColor, PenColorFocused, GradU, GradB, DCaption, DWideCaption, FDefaultCaptionDrawing, AFont, ImgList, FDisabledImages, ImageIndex, EnabledImg, Layout, FDropDownButton {and (Style <> bsCheck)},
DrawDwLn, Enabled, DrawFocused, DropDownPosition, Pic, FIcon, PicSize, AntiAlias, FDefaultPicDrawing, bmp, BD,
FStaticButton or Transparent and not (FMouseEnter or DrawFocusedHot or (State = absDown)), FMouseEnter, Position, DropDownSplit, CanDrawBorder,
FOverlappedText, FWordWrap, True, FRounded, FDropDownDirection,
FSpacing, FTrimming, FNotes, FNotesFont, FDownChecked, FDroppedDown, TranspHover and Transparent, InternalIsOnGlassQAT, MarginHorz, MarginVert, Appearance.NoBorderDefault, AlwaysShowAccel, GetParentForm(Self), DropDownWidth);
is executed. Since the TAdvGlowButton is sitting on a TFrame GetRealParentForm() finds the TFrame as the Control which is not a descendant of TCustomForm. Therefore it returns NIL which causes the exception.

And do you have this issue in both Delphi versions?

Do you have this same error if you do as mentioned before. New TAdvGlowButton on the frame, and adding the frame to the form?
I am using Delphi 10.3 and I can see in my example that GetParentForm returns the correct form.
So would it perhaps be possible to create a simple sample project where you experience this problem, this way we can better pinpoint the cause of your problem.

I missed one important item. The above exception happens only if you change the
MaxButtonSizeState:= bsGlyph inside the designer. Only then, the above call is performed which leads to an exception.

Thank you for letting us know, now we can indeed reproduce this on our system.
We will investigate this further.

We've found the cause of the issue and have fixed the problem.
This fix will be implemented in the following TMS VCL UI Pack.