Hi Stoyo
I added FitDocToObjects after adding the last box and It works!
GREAT!
Thank you very much!
Franco
p.s.
Here a stupid sample code for every delphi programmers who need this feature enabled
procedure TForm1.Button1Click(Sender: TObject);
var
i,j :integer;
x,y :integer;
box1,box2 : IboxItem;
begin
box1 := FlowChart1.CreateBox(100,100,20,20);
FlowChart1.HideScrollers();
for j := 0 to 3 do
for i := 0 to 3 do
begin
x := (i+1)*600;
y := (j+1)*600;
box2:=FlowChart1.CreateBox(x,x,10,10);
FlowChart1.CreateArrow(box1,box2);
end;
FlowChart1.FitDocToObjects(1);
end;
// here's the OnDocBoundsChanged event
procedure TForm1.FlowChart1DocBoundsChanged(ASender: TObject; left, top,
right, bottom: Integer);
begin
FlowChart1.Width := Right - Left;
FlowChart1.Height := Bottom - top;
end;
// note: the Flowchart is inserted in a scrollbox
the Align property of the Flowchart is set to "alNone"
Here's the fragment of the .dfm
object ScrollBox1: TScrollBox
Left = 185
Top = 0
Width = 949
Height = 622
Align = alClient
TabOrder = 1
object FlowChart1: TFlowChart
Left = 0
Top = 0
Width = 1100
Height = 1100
ParentFont = False
TabOrder = 0
OnDocBoundsChanged = FlowChart1DocBoundsChanged
ControlData = {