AnnRestrictToContainer example for Delphi
//This example toggles the "restrict to container" property.
//If an object is restricted to the container, no part of it can be moved outside the container
Procedure TForm1.ExampleRestrictToContainer ( hObject: HANNOBJECT );
var
bRestrict: Boolean;
begin
bRestrict:= LEADAnn1.AnnRestrictToContainer[hObject];
bRestrict:= Not bRestrict;
LEADAnn1.AnnRestrictToContainer[hObject]:= bRestrict;
if (bRestrict = True) then
begin
ShowMessage ('Restricted To Container');
end
else
begin
ShowMessage ('Not Restricted To the Container');
end;
end;