TTMSFNCBadge.OnPositionChange Event
Fires before the badge position changes, allowing the position to be overridden.
API unit family: TMSFNCBadge
Declaring type: TTMSFNCBadge
Inherited from: TTMSFNCCustomBadge
Syntax
OnPositionChange: TMSFNCBadgePositionChangeEvent;
__property TMSFNCBadgePositionChangeEvent OnPositionChange = {read=FOnPositionChange, write=FOnPositionChange};
Usage examples
Constrain badge movement
Adjusts badge coordinates before the badge is positioned.
procedure TForm1.FormCreate(Sender: TObject);
begin
TMSFNCBadge1.OnPositionChange := TMSFNCBadge1PositionChange;
end;
procedure TForm1.TMSFNCBadge1PositionChange(Sender: TObject; var AX: Integer;
var AY: Integer; var AAllow: Boolean);
begin
if AX < 0 then
AX := 0;
if AY < 0 then
AY := 0;
end;
void __fastcall TForm1::FormCreate(TObject *Sender)
{
TMSFNCBadge1->OnPositionChange = TMSFNCBadge1PositionChange;
}
void __fastcall TForm1::TMSFNCBadge1PositionChange(TObject *Sender, int &AX,
int &AY, bool &AAllow)
{
if (AX < 0)
AX = 0;
if (AY < 0)
AY = 0;
}