ButtonMenuTool example for Delphi
// This example is also for:
// ButtonToolCount Property.
//make the first rubber stamp tool draw a rectangle
var
i: integer;
for i:= 0 to LEADAnn1.AnnToolbar.ButtonCount - 1 do
begin
//is this the button with the rubber stamps?
if (LEADAnn1.AnnToolbar.ButtonToolCount [i] > 1 )then
LEADAnn1.AnnToolbar.ButtonMenuTool [i, 0]:= ANNTOOL_RECT;
end;