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;